/* ============================================
   CheckedIn — assets/css/login.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --cream:      #FAF7F2;
    --dark:       #1A1A1A;
    --accent: #FF385C;
    --gray:       #6B6B6B;
    --light-gray: #EFEFEF;
    --border:     #E5E0D8;
    --green:      #2D7A4F;
    --error:      #E8462A;
    --white:      #FFFFFF;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--cream);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- NAV ---- */
.nav {
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

.logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 25px;
    font-weight: 900;
    color: var(--dark);
    text-decoration: none;
    letter-spacing: -0.6px;
}

.logo span {
    color: #FF385C;
}

.nav-link {
    font-size: 0.88rem;
    color: var(--gray);
    text-decoration: none;
    
}

.nav-link:hover { color: var(--dark); }

.nav-link strong {
    color: var(--gray);
    font-weight: 800;
}

/* ---- LAYOUT ---- */
.page-wrap {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - 64px);
}

/* Panel izquierdo — imagen/decoración */
.panel-left {
    background: var(--dark);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3rem;
}

.panel-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(232,70,42,0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(201,151,58,0.15) 0%, transparent 55%);
}

.panel-left-content {
    position: relative;
    z-index: 2;
}

.panel-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
}

.panel-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.15;
    letter-spacing: -2px;
    margin-bottom: 1rem;
}

.panel-title strong {
    font-weight: 700;
    color: var(--accent);
}

.panel-desc {
    color: rgba(255,255,255,0.55);
    font-size: 0.92rem;
    line-height: 1.65;
    max-width: 340px;
    margin-bottom: 2rem;
}

.stats-row {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-num {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    letter-spacing: -1px;
    line-height: 1;
}

.stat-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.80rem;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
}

/* Decoración fondo */
.deco-circles {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.06);
    z-index: 1;
}

.deco-circles::before {
    content: '';
    position: absolute;
    inset: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.06);
}

.deco-circles::after {
    content: '';
    position: absolute;
    inset: 80px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.06);
}

/* ---- PANEL DERECHO — FORMULARIO ---- */
.panel-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--cream);
}

.login-box {
    width: 100%;
    max-width: 400px;
}

.login-header {
    margin-bottom: 2.5rem;
}

.login-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.4rem;
}

.login-subtitle {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ---- FORMULARIO ---- */
.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1rem;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.8rem;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--dark);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--dark);
    box-shadow: 0 0 0 3px rgba(26,26,26,0.08);
}

.form-input::placeholder { color: #C0BAB0; }

/* Toggle contraseña */
.toggle-pass {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray);
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.toggle-pass:hover { color: var(--dark); }

/* ---- ALERTA ERROR ---- */
.alert-error {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #FFF0EE;
    border: 1px solid #F5C0B8;
    color: #B83220;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}



/* ---- OPCIONES ---- */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--gray);
}

.checkbox-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--dark);
    cursor: pointer;
}

.forgot-link {
    color: var(--gray);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.forgot-link:hover { color: var(--dark); text-decoration: underline; }

/* ---- BOTÓN ---- */
.btn-login {
    width: 100%;
    background: var(--dark);
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    position: relative;
    overflow: hidden;
}

.btn-login:hover { background: #2D2D2D; }
.btn-login:active { transform: scale(0.98); }

.btn-login.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-login.loading .btn-text  { display: none; }
.btn-login.loading .btn-spinner { display: block; }

/* ---- DIVISOR ---- */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--gray);
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---- FOOTER DEL FORM ---- */
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--gray);
}

.login-footer a {
    color: var(--dark);
    font-weight: 500;
    text-decoration: none;
}

.login-footer a:hover { text-decoration: underline; }

/* ---- RESPONSIVE MÓVIL LOGIN IGUAL QUE REGISTRO ---- */
@media (max-width: 768px) {

    .nav {
        height: 60px;
        padding: 0 22px;
    }

    .logo {
        font-size: 25px;
    }

    .nav-link {
        font-size: 13px;
        line-height: 1.2;
        text-align: right;
        max-width: 125px;
    }

    .page-wrap {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 60px);
    }

    .panel-left {
        display: none;
    }

    .panel-right {
        padding: 28px 22px 54px;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .login-box {
        width: 100%;
        max-width: 100%;
    }

    .login-header {
        text-align: center;
        margin-bottom: 28px;
    }

    .login-title {
        font-size: 28px;
        line-height: 1.12;
        letter-spacing: -1.1px;
        margin-bottom: 12px;
    }

    .login-subtitle {
        font-size: 16px;
        line-height: 1.5;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-label {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .form-input {
        height: 52px;
        font-size: 15px;
        padding: 0 48px 0 46px;
        border-radius: 13px;
    }

    .input-icon {
        left: 16px;
    }

    .input-icon svg {
        width: 19px;
        height: 19px;
    }

    .toggle-pass {
        right: 16px;
    }

    .toggle-pass svg {
        width: 20px;
        height: 20px;
    }

    .form-options {
        font-size: 14px;
        margin-bottom: 22px;
    }

    .checkbox-wrap input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .forgot-link {
        font-size: 14px;
    }

    .btn-login {
        height: 52px;
        font-size: 16px;
        font-weight: 700;
        border-radius: 13px;
    }

    .divider {
        margin: 24px 0;
        font-size: 14px;
    }

    .login-footer {
        font-size: 15px;
        line-height: 1.4;
    }
}


@media (max-width: 430px) {

    .nav {
        padding: 0 22px;
    }

    .logo {
        font-size: 25px;
    }

    .nav-link {
        font-size: 14px;
        max-width: 140px;
    }

    .login-title {
        font-size: 28px;
    }

    .login-subtitle {
        font-size: 16px;
    }
}



/* ---- ALERTA BLOQUEO (rate limit) ---- */
.alert-blocked {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: #FFF7ED;
    border: 1px solid #F5C47B;
    color: #92400E;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

#countdown {
    font-weight: 600;
}

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

.toggle-pass {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-pass svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
}