/**
 * ==============================================================================
 * DASHBOARD DE LA PAGINA DE ACCESO
 * ==============================================================================
 *
 * ÍNDICE DE SECCIONES:
 * 1.  VARIABLES Y RESET
 * 2.  CAPAS DE FONDO
 * 3.  CONTENEDOR Y CARD PRINCIPAL
 * 4.  LOGO
 * 5.  TÍTULO Y SUBTÍTULO
 * 6.  MENSAJE DE ERROR
 * 7.  DIVIDER
 * 8.  INFO BOX
 * 9.  BOTÓN STEAM
 * 10. CARD DE USUARIO CONECTADO
 * 11. SECCIÓN SERVIDORES
 * 12. PROGRESO VINCULAR + CARDS
 * 13. HINT INFORMATIVO
 * 14. RESPONSIVE
 * ==============================================================================
 */


/* ==============================================================================
   1. VARIABLES Y RESET
   ============================================================================== */
:root {
    --color-bg:          #181a2a;
    --color-bg-card:     rgba(12, 16, 38, 0.94);
    --color-primary:     #6c7aff;
    --color-accent:      #19f0ff;
    --color-text:        #e3e6fa;
    --color-text-muted:  #7e8bb6;
    --color-border:      rgba(21, 217, 255, 0.18);
    --color-danger:      #ff5c5c;
    --color-discord:     #5865f2;
    --color-warning:     #ffb832;
    --color-success:     #4ee0a0;
    --color-steam-light: #66c0f4;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    font-family: 'Roboto', 'Segoe UI', Arial, Helvetica, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

/* ==============================================================================
   2. CAPAS DE FONDO
   ============================================================================== */

.bg-image-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: var(--fondo-url, #181a2a) center center / cover no-repeat;
    opacity: 0.42;
}

.bg-blur-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(14, 17, 36, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ==============================================================================
   3. CONTENEDOR Y CARD PRINCIPAL
   ============================================================================== */

.login-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 24px 16px;
}

.login-card {
    background: var(--color-bg-card);
    border: 1px solid rgba(21, 217, 255, 0.18);
    border-radius: 20px;
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(21, 217, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: cardSlideIn 0.28s ease-out;
}

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(-18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   4. LOGO
   ============================================================================== */

.login-logo {
    display: block;
    max-width: 140px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(21, 217, 255, 0.22));
    margin-bottom: 4px;
}

/* ==============================================================================
   5. TÍTULO Y SUBTÍTULO
   ============================================================================== */

.login-title {
    font-size: 1.35em;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.4px;
    text-align: center;
    line-height: 1.2;
}

.login-subtitle {
    font-size: 0.84em;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.4;
    margin-top: -10px;
}

/* ==============================================================================
   6. MENSAJE DE ERROR
   ============================================================================== */

.login-error {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: rgba(255, 80, 80, 0.12);
    border: 1px solid rgba(255, 80, 80, 0.38);
    border-radius: 10px;
    padding: 10px 14px;
    color: #ff7a7a;
    font-size: 0.88em;
    font-weight: 500;
    animation: shakeError 0.4s ease;
    line-height: 1.4;
}

.login-error .material-symbols-outlined {
    font-size: 18px;
    flex-shrink: 0;
    color: var(--color-danger);
}

@keyframes shakeError {
    0%  { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
    100%{ transform: translateX(0); }
}

/* ==============================================================================
   7. DIVIDER
   ============================================================================== */

.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.login-divider-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.login-divider-text {
    font-size: 0.76em;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* ==============================================================================
   8. INFO BOX
   ============================================================================== */

.info-box {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.8em;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.info-box.info {
    background: rgba(21, 217, 255, 0.06);
    border: 1px solid rgba(21, 217, 255, 0.15);
    color: rgba(227, 230, 250, 0.8);
}

.info-box.success {
    background: rgba(67, 181, 129, 0.08);
    border: 1px solid rgba(67, 181, 129, 0.2);
    color: #8ee4b4;
}

.info-box.warn {
    background: rgba(255, 184, 50, 0.07);
    border: 1px solid rgba(255, 184, 50, 0.28);
    color: #ffe0a0;
}

.info-box .material-symbols-outlined {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box a {
    color: var(--color-accent);
    text-decoration: underline;
    font-weight: 600;
}

/* ==============================================================================
   9. BOTÓN STEAM
   ============================================================================== */

.steam-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1.5px solid rgba(102, 192, 244, 0.35);
    background: rgba(27, 40, 56, 0.65);
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.18s;
}

.steam-btn:hover {
    border-color: rgba(102, 192, 244, 0.7);
    background: rgba(27, 40, 56, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(102, 192, 244, 0.15);
}

.steam-btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    flex-shrink: 0;
    background: rgba(102, 192, 244, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-steam-light);
}

.steam-svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.steam-btn-text { text-align: left; }

.steam-btn-title {
    display: block;
    font-weight: 700;
    font-size: 0.95em;
    color: var(--color-steam-light);
}

.steam-btn-sub {
    display: block;
    font-size: 0.77em;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* ==============================================================================
   10. CARD DE USUARIO CONECTADO
   ============================================================================== */

.user-card {
    width: 100%;
    border-radius: 14px;
    border: 1.5px solid rgba(102, 192, 244, 0.3);
    background: rgba(27, 40, 56, 0.55);
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 13px;
    animation: fadeUp 0.3s ease;
}

.user-card.su-card {
    border-color: rgba(255, 184, 50, 0.45);
    background: rgba(255, 140, 0, 0.07);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1b2838, #263d5a);
    border: 2px solid rgba(102, 192, 244, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.user-card.su-card .user-avatar {
    border-color: rgba(255, 184, 50, 0.5);
}

.user-avatar-icon {
    font-size: 22px !important;
    color: var(--color-steam-light);
    font-variation-settings: 'FILL' 1;
}

.user-card.su-card .user-avatar-icon {
    color: #ffd070;
}

.online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--color-success);
    border: 2px solid rgba(12, 16, 38, 0.9);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 700;
    font-size: 0.9em;
    color: var(--color-steam-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.user-card.su-card .user-name {
    color: #ffd070;
}

.user-sublabel {
    font-size: 0.73em;
    color: var(--color-text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-sublabel .material-symbols-outlined {
    font-size: 12px;
}

.btn-disconnect {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex-shrink: 0;
    border: 1.5px solid rgba(255, 92, 92, 0.3);
    background: rgba(255, 92, 92, 0.07);
    color: rgba(255, 92, 92, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.17s;
    text-decoration: none;
}

.btn-disconnect:hover {
    border-color: rgba(255, 92, 92, 0.65);
    background: rgba(255, 92, 92, 0.15);
    color: #ff8080;
}

.btn-disconnect .material-symbols-outlined {
    font-size: 17px;
}

/* ==============================================================================
   11. SECCIÓN SERVIDORES
   ============================================================================== */

.servers-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.servers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.76em;
    font-weight: 800;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.servers-count {
    font-size: 0.88em;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 5px;
    background: rgba(21, 217, 255, 0.1);
    border: 1px solid rgba(21, 217, 255, 0.22);
    color: var(--color-accent);
    text-transform: none;
    letter-spacing: 0;
}

/* (eliminado: .servers-count.su y .servers-count.mod — clases no emitidas por el template) */

.server-item {
    width: 100%;
    border-radius: 12px;
    border: 1.5px solid rgba(21, 217, 255, 0.14);
    background: rgba(255, 255, 255, 0.025);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: block;
}

.server-item:not(.server-item-locked):hover {
    border-color: rgba(21, 217, 255, 0.4);
    box-shadow: 0 2px 12px rgba(21, 217, 255, 0.07);
}

.server-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.server-item.server-item-locked .server-header {
    cursor: default;
    opacity: 0.45;
}

.server-item:not(.server-item-locked) .server-header:hover {
    background: rgba(21, 217, 255, 0.04);
}

.server-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    flex-shrink: 0;
    border: 1px solid rgba(21, 217, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
}

.server-icon-lock {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.25);
}

.server-header-info {
    flex: 1;
    min-width: 0;
}

.server-name {
    font-weight: 700;
    font-size: 0.88em;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.servers-locked .server-name {
    color: rgba(255, 255, 255, 0.3);
}

.server-meta {
    font-size: 0.72em;
    color: var(--color-text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.dot-online {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-success);
    flex-shrink: 0;
}

.dot-offline {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 92, 92, 0.65);
    flex-shrink: 0;
}

.server-role-badge {
    font-size: 0.68em;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.server-role-badge.owner {
    background: rgba(255, 184, 50, 0.12);
    border: 1px solid rgba(255, 184, 50, 0.28);
    color: #ffd070;
}

.server-role-badge.admin {
    background: rgba(21, 217, 255, 0.1);
    border: 1px solid rgba(21, 217, 255, 0.24);
    color: var(--color-accent);
}

.server-role-badge.mod {
    background: rgba(78, 224, 160, 0.1);
    border: 1px solid rgba(78, 224, 160, 0.26);
    color: var(--color-success);
}

.server-chevron {
    font-size: 18px !important;
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: color 0.18s;
}

.server-item:not(.server-item-locked):hover .server-chevron {
    color: var(--color-accent);
}

/* ==============================================================================
   12. PROGRESO VINCULAR + CARDS
   ============================================================================== */

.link-progress {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0;
    margin: 4px 0;
}

.link-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.link-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-muted);
    z-index: 2;
    position: relative;
}

.link-step-circle.done {
    border-color: #43b581;
    background: rgba(67, 181, 129, 0.15);
    color: #43b581;
}

.link-step-circle.active {
    border-color: var(--color-accent);
    background: rgba(21, 217, 255, 0.1);
    color: var(--color-accent);
    box-shadow: 0 0 12px rgba(21, 217, 255, 0.2);
}

.link-step-label {
    font-size: 0.7em;
    color: var(--color-text-muted);
    font-weight: 500;
    text-align: center;
}

.link-step-label.done   { color: #43b581; }
.link-step-label.active { color: var(--color-accent); }

.link-connector {
    flex: 0 0 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    margin-top: -20px;
    transition: background 0.3s;
}

.link-connector.done { background: #43b581; }

/* Cards de vinculación */
.vincular-steam-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    background: rgba(27, 40, 56, 0.3);
    border: 1px solid rgba(102, 192, 244, 0.18);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
    user-select: none;
}

.vincular-steam-card:hover {
    background: rgba(27, 40, 56, 0.5);
    border-color: rgba(102, 192, 244, 0.35);
    box-shadow: 0 0 16px rgba(102, 192, 244, 0.10);
}

.vincular-steam-card.connected,
.vincular-discord-card.connected {
    cursor: default;
    border-color: rgba(67, 181, 129, 0.35);
    background: rgba(67, 181, 129, 0.07);
}

.vincular-discord-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    background: rgba(88, 101, 242, 0.07);
    border: 1px solid rgba(88, 101, 242, 0.22);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
    user-select: none;
}

.vincular-discord-card:hover {
    background: rgba(88, 101, 242, 0.14);
    border-color: rgba(88, 101, 242, 0.4);
    box-shadow: 0 0 16px rgba(88, 101, 242, 0.10);
}

.vincular-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vincular-card-icon.steam   { background: rgba(102, 192, 244, 0.12); color: #66c0f4; }
.vincular-card-icon.discord { background: rgba(88, 101, 242, 0.18);  color: #8ea0ff; }

.vincular-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.vincular-card-name {
    font-size: 0.92em;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vincular-card-id {
    font-size: 0.72em;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vincular-card-arrow {
    font-size: 22px;
    color: rgba(126, 139, 182, 0.45);
    flex-shrink: 0;
    transition: color 0.18s, transform 0.18s;
}

.vincular-steam-card:hover .vincular-card-arrow,
.vincular-discord-card:hover .vincular-card-arrow {
    color: rgba(126, 139, 182, 0.7);
    transform: translateX(2px);
}

.check-icon {
    color: #43b581;
    font-size: 20px !important;
}

/* Caja ya vinculada */
.already-linked-box {
    width: 100%;
    padding: 20px;
    border-radius: 14px;
    background: rgba(67, 181, 129, 0.06);
    border: 1px solid rgba(67, 181, 129, 0.22);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.already-linked-icon {
    font-size: 32px !important;
    color: #43b581;
    margin-bottom: 2px;
}

.already-linked-title {
    font-size: 1em;
    font-weight: 700;
    color: #43b581;
}

.already-linked-name {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--color-text);
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.already-linked-note {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68em;
    color: rgba(126, 139, 182, 0.55);
    margin-top: 4px;
}

/* ==============================================================================
   13. HINT INFORMATIVO
   ============================================================================== */

.login-hint {
    font-size: 0.75em;
    color: rgba(126, 139, 182, 0.65);
    text-align: center;
    line-height: 1.45;
    padding: 0 4px;
}

/* ==============================================================================
   14. RESPONSIVE
   ============================================================================== */

@media (max-width: 480px) {
    .login-card {
        padding: 28px 18px 22px;
        border-radius: 16px;
    }

    .login-logo {
        max-width: 110px;
    }

    .login-title {
        font-size: 1.18em;
    }
}
