/* =============================================
   styles.css - Versión Limpia (Login & Dashboard)
   ============================================= */
:root {
    /* PALETA INSTITUCIONAL BIENESTAR */
    --primary: #a02041;
    --primary-dark: #8b0000;
    --primary-soft: rgba(160, 32, 65, 0.10);

    --success: #107c41;
    --success-soft: rgba(16, 124, 65, 0.15);

    --warning: #BC955C;
    --warning-soft: rgba(188, 149, 92, 0.15);

    --danger: #b91c1c;
    --danger-soft: rgba(185, 28, 28, 0.15);

    /* Colores de fondo - Tema claro */
    --dark: #1e1e2e;
    --darker: #f5f5f7;
    --bg-panel: #ffffff;
    --bg-light: #f8f8fa;
    --border-light: #e0e0e8;
    --text-white: #1a1a2e;
    --text-gray: #64748b;
    --white: #ffffff;

    --header-height: 56px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: var(--darker);
    color: var(--text-white);
    overflow-x: hidden; /* Evitar scroll horizontal */
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(145deg, #f5f5f7 0%, #e8e8f0 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: var(--bg-panel);
    border-radius: 24px;
    padding: 48px 40px;
    border: 1px solid var(--border-light);
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

.logo-container {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 10px 30px rgba(160, 32, 65, 0.3);
}

/* Estilo específico para el logo en dashboard si se usa */
.logoIndex {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(160, 32, 65, 0.3);
}

.login-box h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    color: var(--primary-dark);
}

.login-box .subtitle {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--text-gray);
    font-size: 0.95rem;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-white);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(160, 32, 65, 0.3);
}

.error-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--danger-soft);
    border: 1px solid rgba(185, 28, 28, 0.3);
    border-radius: 10px;
    color: var(--danger);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.footer-text {
    margin-top: 32px;
    color: var(--text-gray);
    font-size: 0.8rem;
}

/* =============================================
   APP PAGE - HEADER (Dashboard)
   ============================================= */
.app-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#protocol-screen {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--darker);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

header {
    height: var(--header-height);
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(160, 32, 65, 0.25);
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-text-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--primary-dark);
}

.brand-separator {
    width: 1px;
    height: 14px;
    background: var(--border-light);
}

.brand-tagline {
    font-size: 0.8rem;
    color: var(--text-gray);
    font-weight: 400;
}

.user-greeting {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =============================================
   BUTTONS (General & Header)
   ============================================= */
.btn-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-logout {
    background: var(--bg-light);
    color: var(--text-gray);
    border: 1px solid var(--border-light);
}

.btn-logout:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger);
}

/* =============================================
   UTILIDADES
   ============================================= */
::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media screen and (max-width: 1700px) and (min-width: 1500px) {
    :root {
        --header-height: 54px;
    }

    header {
        padding: 0 16px;
    }

    .header-logo {
        width: 38px;
        height: 38px;
    }

    .brand-name {
        font-size: 1.05rem;
    }

    .btn-header {
        padding: 7px 14px;
        font-size: 0.8rem;
    }
}

@media screen and (max-width: 1499px) {
    :root {
        --header-height: 52px;
    }

    .brand-tagline,
    .brand-separator {
        display: none;
    }

    .btn-header {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}
