/* Outfit — fuente local, sin dependencia de Google Fonts */
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/outfit-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/outfit-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg-dark-900: #0a0a0c;
    --bg-dark-800: #121217;
    --bg-dark-700: #1a1a23;
    
    --primary-gold: #c5a86a;
    --primary-gold-hover: #e0c487;
    
    --accent-purple: #4b235e;
    --accent-purple-light: #70338c;
    
    --text-main: #f5f5f7;
    --text-muted: #8e8e9f;
    --text-gold: #e2cca2;

    --border-color: rgba(197, 168, 106, 0.2);
    --border-color-focus: rgba(197, 168, 106, 0.5);
    
    --shadow-gold: 0 0 15px rgba(197, 168, 106, 0.1);
    --shadow-glow: 0 0 25px rgba(112, 51, 140, 0.35);

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark-900);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================================================
   LAYOUT DE AUTENTICACIÓN
   ========================================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at center, #1b0f2a 0%, #0a0a0c 100%);
    position: relative;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54 48c-2 0-3 1-4 2v4c0 1-1 2-2 2h-4c-1 0-2-1-2-2v-4c0-1-1-2-4-2H8c-2 0-3 1-4 2v4c0 1-1 2-2 2H0v-8c0-2 1-3 2-4h4c1 0 2-1 2-2v-4c0-1 1-2 4-2h28c2 0 3-1 4-2v-4c0-1 1-2 2-2h4c1 0 2 1 2 2v4c0 1 1 2 4 2h4c2 0 3-1 4-2v-4c0-1 1-2 2-2h4v8c0 2-1 3-2 4h-4c-1 0-2 1-2 2v4c0 1-1 2-4 2zM30 20c-2 0-3 1-4 2v4c0 1-1 2-2 2h-4c-1 0-2-1-2-2v-4c0-1-1-2-4-2H4c-2 0-3 1-4 2v4c0 1-1 2-2 2H0v-8c0-2 1-3 2-4h4c1 0 2-1 2-2v-4c0-1 1-2 4-2h8c2 0 3-1 4-2v-4c0-1 1-2 2-2h4c1 0 2 1 2 2v4c0 1 1 2 4 2h8c2 0 3-1 4-2v-4c0-1 1-2 2-2h4v8c0 2-1 3-2 4h-4c-1 0-2 1-2 2v4c0 1-1 2-4 2z' fill='%23c5a86a' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(18, 18, 23, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-glow);
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(112, 51, 140, 0.45), var(--shadow-gold);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--primary-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================================================================
   COMPONENTES DE FORMULARIO
   ========================================================================== */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-gold);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    background-color: var(--bg-dark-900);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 10px rgba(197, 168, 106, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--bg-dark-800) 100%);
    border: 1px solid var(--primary-gold);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.btn:hover {
    background: linear-gradient(135deg, var(--accent-purple-light) 0%, var(--accent-purple) 100%);
    box-shadow: 0 0 15px rgba(197, 168, 106, 0.3);
    transform: scale(1.02);
}

.btn:active {
    transform: scale(0.98);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    margin-left: 5px;
}

.auth-footer a:hover {
    color: var(--primary-gold-hover);
    text-decoration: underline;
}

/* ==========================================================================
   MENSAJES DE ALERTA Y ERROR
   ========================================================================== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border-left: 3px solid;
    animation: fadeIn 0.3s ease;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #ff6b7a;
    border-color: #dc3545;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: #5ddc74;
    border-color: #28a745;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar-nav a:hover {
    background: rgba(197, 168, 106, 0.08) !important;
    border-color: rgba(197, 168, 106, 0.3) !important;
    color: var(--primary-gold-hover) !important;
    transform: translateX(3px);
}

.sidebar-nav a {
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

/* ==========================================================================
   DISEÑO 3 COLUMNAS ESTILO ELDORIA
   ========================================================================== */
.eldoria-layout {
    display: grid;
    grid-template-columns: 80px 1fr 320px;
    min-height: 100vh;
    background-color: var(--bg-dark-900);
}

/* Sidebar Izquierdo de Iconos Estrecho */
.icon-sidebar {
    background: #09090c;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    justify-content: space-between;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 200;
}

.icon-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--primary-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-gold);
    margin-bottom: 30px;
}

.icon-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    width: 100%;
}

.icon-link {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid transparent;
}

.icon-link:hover {
    color: var(--primary-gold-hover);
    background: rgba(197, 168, 106, 0.08);
    border-color: rgba(197, 168, 106, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(112, 51, 140, 0.15);
}

.icon-link.active {
    color: var(--primary-gold);
    background: rgba(75, 35, 94, 0.15);
    border-color: var(--border-color);
    box-shadow: var(--shadow-glow);
}

/* Cabecera Superior */
.top-header {
    background: rgba(18, 18, 23, 0.75);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary-gold);
    text-shadow: 0 0 10px rgba(197,168,106,0.2);
}

.header-resources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
}

.resource-pill {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.04);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

/* Sidebar Derecho */
.right-sidebar {
    background: #09090c;
    border-left: 1px solid var(--border-color);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    z-index: 100;
}

.right-panel-card {
    background: rgba(18, 18, 23, 0.7);
    border: 1px solid rgba(197, 168, 106, 0.12);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(5px);
}

.right-panel-title {
    font-size: 0.75rem;
    color: var(--text-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    padding-bottom: 6px;
}

/* Chat Rápido SSE Container */
.chat-container-panel {
    display: flex;
    flex-direction: column;
    height: 280px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 8px;
    overflow: hidden;
}

.chat-tabs {
    display: flex;
    background: rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.chat-tab {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}

.chat-tab.active {
    color: var(--primary-gold);
    background: rgba(197, 168, 106, 0.05);
    border-bottom: 1.5px solid var(--primary-gold);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.78rem;
}

.chat-input-row {
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.5);
}

.chat-input-field {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 12px;
    color: #fff;
    font-size: 0.78rem;
}

.chat-input-field:focus {
    outline: none;
}

.chat-send-btn {
    background: transparent;
    border: none;
    color: var(--primary-gold);
    padding: 0 12px;
    cursor: pointer;
    font-size: 0.85rem;
}

.chat-send-btn:hover {
    color: var(--primary-gold-hover);
}

/* Mensajes individuales del chat */
.chat-msg {
    line-height: 1.35;
    word-break: break-word;
    padding: 2px 0;
}

.chat-msg-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    flex-shrink: 0;
}

.chat-msg-nombre {
    font-weight: 600;
    font-size: 0.76rem;
    color: var(--text-main);
}

.chat-msg-sep {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.chat-msg-texto {
    font-size: 0.76rem;
    color: #ccc;
}

.chat-msg-hora {
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-right: 4px;
    opacity: 0.7;
}

/* =============================================
   TIENDA DEL DESIGNIO
   ============================================= */

.moneda-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(197,168,106,0.2);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-gold);
    white-space: nowrap;
}

.tienda-card {
    cursor: default;
}

.tienda-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(197,168,106,0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(197,168,106,0.45);
}
