/* ============================================================
   auth.css — Agro El Patrón
   Vista exclusiva para login y pantallas de autenticación
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Lato:wght@300;400;700&display=swap');

/* ── Reset de la vista ─────────────────────────────────────── */
body.auth-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Lato', sans-serif;
    background: #0a1628;
    overflow: hidden;
}

/* ── Contenedor principal ──────────────────────────────────── */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ══════════════════════════════════════════════════════════════
   PANEL IZQUIERDO — identidad visual
══════════════════════════════════════════════════════════════ */
.auth-brand-panel {
    position: relative;
    width: 52%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    overflow: hidden;

    background:
        linear-gradient(160deg,
            #0d1b2b 0%,
            #1a3a5c 30%,
            #2d5f8a 55%,
            #1e2d4a 80%,
            #0a1628 100%);
}

/* Textura de grano */
.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.07'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

/* Círculos decorativos de fondo */
.auth-brand-panel::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(100,160,230,0.07) 0%, transparent 70%);
    top: -100px;
    right: -150px;
    pointer-events: none;
}

.auth-brand-deco {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45,95,138,0.15) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    pointer-events: none;
}

/* Logo */
.auth-logo-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    animation: fadeSlideUp 0.8s ease both;
}

.auth-logo {
    width: clamp(200px, 30vw, 320px);
    filter: drop-shadow(0 8px 32px rgba(0,0,0,0.6))
            drop-shadow(0 2px 8px rgba(100,160,230,0.25));
    transition: transform 0.4s ease;
}
.auth-logo:hover {
    transform: scale(1.03);
}

.auth-brand-tagline {
    font-family: 'Lato', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: rgba(140,190,240,0.8);
    text-align: center;
}

/* Separador decorativo */
.auth-brand-divider {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 70%;
    margin-top: 2.5rem;
    animation: fadeSlideUp 1s ease 0.15s both;
}
.auth-brand-divider span {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(100,160,230,0.35), transparent);
}
.auth-brand-divider i {
    color: rgba(100,160,230,0.45);
    font-size: 0.7rem;
}

/* Texto inferior */
.auth-brand-footer {
    position: relative;
    z-index: 2;
    margin-top: 2rem;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.3);
    animation: fadeSlideUp 1s ease 0.25s both;
}

/* ══════════════════════════════════════════════════════════════
   PANEL DERECHO — formulario
══════════════════════════════════════════════════════════════ */
.auth-form-panel {
    width: 48%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: #f2f6fb;
    position: relative;
    overflow-y: auto;
}

/* Detalle en la esquina */
.auth-form-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #4a90d9, #2d5f8a, #1e2d4a);
}

.auth-form-inner {
    width: 100%;
    max-width: 420px;
    animation: fadeSlideUp 0.7s ease 0.1s both;
}

/* Encabezado del form */
.auth-form-header {
    margin-bottom: 2.5rem;
}

.auth-form-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #2d5f8a;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-form-title {
    font-family: 'Cinzel', serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    margin: 0 0 0.5rem;
}

.auth-form-subtitle {
    font-size: 0.88rem;
    color: #888;
    margin: 0;
}

/* Labels */
.auth-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 0.45rem;
}

/* Inputs */
.auth-input-wrap {
    position: relative;
    margin-bottom: 1.4rem;
}

.auth-input-wrap .auth-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: #2d5f8a;
    box-shadow: 0 0 0 3px rgba(45,95,138,0.12);
}

.auth-input:focus + .auth-focus-bar {
    width: 100%;
}

.auth-input-wrap:focus-within .auth-icon {
    color: #2d5f8a;
}

/* Botón principal */
.auth-btn {
    width: 100%;
    padding: 0.95rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #1a3a5c 0%, #2d5f8a 50%, #1a3a5c 100%);
    background-size: 200% 200%;
    transition: background-position 0.4s ease, transform 0.15s, box-shadow 0.3s;
    box-shadow: 0 4px 16px rgba(45,95,138,0.3);
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.auth-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(100,160,230,0.12) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.auth-btn:hover {
    background-position: right center;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(45,95,138,0.4);
}
.auth-btn:hover::after { opacity: 1; }
.auth-btn:active { transform: translateY(0); }

/* Alerta de error */
.auth-alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background: #deeaf8;
    border-left: 4px solid #4a90d9;
    color: #1a3a5c;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Botones demo */
.auth-demo-btn {
    display: block;
    width: 100%;
    padding: 0.85rem;
    border-radius: 8px;
    text-align: center;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.2s;
    margin-bottom: 0.8rem;
}
.auth-demo-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}
.auth-demo-btn.admin {
    background: #1a3a5c;
    color: #fff;
    box-shadow: 0 3px 12px rgba(26,58,100,0.3);
}
.auth-demo-btn.branch {
    background: #1e2d4a;
    color: #fff;
    box-shadow: 0 3px 12px rgba(20,40,80,0.3);
}

/* ── Animación de entrada ───────────────────────────────────── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    body.auth-page { overflow: auto; }

    .auth-wrapper {
        flex-direction: column;
        min-height: 100vh;
    }

    .auth-brand-panel {
        width: 100%;
        padding: 2.5rem 2rem 2rem;
        min-height: 260px;
    }

    .auth-logo { width: 180px; }

    .auth-form-panel {
        width: 100%;
        padding: 2rem 1.5rem 3rem;
    }

    .auth-form-panel::before {
        width: 100%;
        height: 4px;
        left: 0;
        top: 0;
    }
}