/**
 * assets/css/auth.css
 * ServiclimasMTY — Estilos para páginas de autenticación (Login, Registro).
 *
 * Estructura de layout soportada:
 *   a) Panel centrado simple:   .auth-wrapper > .auth-panel
 *   b) Layout dividido (split): .auth-split > .auth-split-bg + .auth-split-form
 *
 * Para activar la imagen de fondo en layout split, define en el atributo style
 * del elemento .auth-split-bg:
 *   style="background-image: url('/assets/img/auth/background.jpg');"
 * La imagen debe ser ≥ 1200 × 900 px, formato JPG o WebP.
 */

:root {
    --fj-navy:      #0c2340;
    --fj-blue:      #1565c0;
    --fj-cyan:      #00b4d8;
    --fj-cyan-glow: rgba(0,180,216,.25);
}

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

body {
    font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #edf1f5;
    color: #1e293b;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════
   Layout A — Panel centrado (uso actual de login / registro)
══════════════════════════════════════════════════════════════ */
.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* ══════════════════════════════════════════════════════════════
   Layout B — Split: mitad imagen / mitad formulario
   Activar cambiando .auth-wrapper por .auth-split en el HTML.
══════════════════════════════════════════════════════════════ */
.auth-split {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* Columna izquierda: imagen de fondo con overlay oscuro */
.auth-split-bg {
    position: relative;
    background-color: var(--fj-navy);
    background-size: cover;
    background-position: center;
    /* Placeholder visual hasta que se asigne una imagen real */
    background-image: linear-gradient(160deg, #0c2340 0%, #1565c0 50%, #00b4d8 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 48px;
}

/* Overlay semitransparente sobre la imagen para legibilidad del texto */
.auth-split-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(12,35,64,.85) 0%, rgba(12,35,64,.25) 100%);
    pointer-events: none;
}

.auth-split-bg-content {
    position: relative;
    z-index: 1;
    color: white;
}

.auth-split-bg-content .brand {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -.5px;
    margin-bottom: 12px;
}

.auth-split-bg-content .tagline {
    font-size: 1rem;
    color: rgba(255,255,255,.75);
    max-width: 340px;
    line-height: 1.6;
}

.auth-split-bg-content .badges {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.auth-split-bg-content .badge-item {
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: .78rem;
    color: rgba(255,255,255,.9);
}

/* Columna derecha: formulario centrado */
.auth-split-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
    overflow-y: auto;
}

.auth-split-form .auth-panel {
    box-shadow: none;
    border-radius: 0;
    max-width: 420px;
    width: 100%;
    animation: none;
}

/* Colapsar a una sola columna en mobile */
@media (max-width: 768px) {
    .auth-split {
        grid-template-columns: 1fr;
    }
    .auth-split-bg {
        display: none; /* Ocultar imagen en mobile para maximizar espacio del form */
    }
    .auth-split-form {
        min-height: 100vh;
    }
}

.auth-panel {
    width: 100%;
    max-width: 460px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.1), 0 1px 4px rgba(0,0,0,.06);
    overflow: hidden;
    animation: panelSlide .4s ease both;
}

@keyframes panelSlide {
    from { opacity: 0; transform: translateY(24px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Cabecera del panel ──────────────────────────────────────── */
.auth-header {
    background: var(--fj-navy);
    padding: 32px 36px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--fj-blue);
}

.auth-logo {
    width: 90px;
    height: 90px;
    background: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
    position: relative;
    z-index: 1;
    padding: 10px;
}

.auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.auth-header p {
    font-size: .88rem;
    color: rgba(255,255,255,.65);
    position: relative;
    z-index: 1;
}

/* ── Cuerpo del panel ────────────────────────────────────────── */
.auth-body {
    padding: 32px 36px;
}

/* ── Grupos de formulario ────────────────────────────────────── */
.auth-group {
    margin-bottom: 20px;
}

.auth-label {
    display: block;
    font-size: .84rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 7px;
    letter-spacing: .3px;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    transition: color .2s;
}

.auth-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: .95rem;
    font-family: 'IBM Plex Sans', sans-serif;
    color: #1e293b;
    background: white;
    transition: border-color .2s, box-shadow .2s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--fj-blue);
    box-shadow: 0 0 0 3px rgba(21,101,192,.1);
}

.auth-input:focus + i,
.auth-input-wrap:focus-within > i {
    color: var(--fj-blue);
}

/* Select */
.auth-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%2394a3b8' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 40px;
}

/* Toggle contraseña */
.btn-toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    transition: color .2s;
}

.btn-toggle-pass:hover { color: #475569; }

/* ── Alerta de error ─────────────────────────────────────────── */
.auth-alert {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: .88rem;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-alert.success {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #166534;
}

/* ── Botón principal ─────────────────────────────────────────── */
.auth-btn {
    width: 100%;
    padding: 13px;
    background: #1565c0;
    color: white;
    border: none;
    border-radius: 9px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'IBM Plex Sans', sans-serif;
    cursor: pointer;
    transition: background .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: .3px;
    margin-top: 6px;
}

.auth-btn:hover {
    background: #0d47a1;
}

/* ── Enlace secundario ───────────────────────────────────────── */
.auth-link-row {
    text-align: center;
    margin-top: 20px;
    font-size: .88rem;
    color: #64748b;
}

.auth-link-row a {
    color: var(--fj-blue);
    font-weight: 600;
    text-decoration: none;
}

.auth-link-row a:hover { text-decoration: underline; }

/* ── Info box credenciales ───────────────────────────────────── */
.auth-info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 9px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: .83rem;
    color: #0369a1;
}

.auth-info-box strong { display: block; margin-bottom: 4px; color: #0c4a6e; }
.auth-info-box code  { font-family: 'IBM Plex Mono', monospace; font-size: .9em; }

/* ── Separador con texto ─────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #94a3b8;
    font-size: .82rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ── Footer ──────────────────────────────────────────────────── */
.auth-footer {
    background: var(--fj-navy);
    color: rgba(255,255,255,.5);
    text-align: center;
    padding: 14px;
    font-size: .78rem;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-panel { border-radius: 12px; }
    .auth-header { padding: 24px 24px 20px; }
    .auth-body   { padding: 24px; }
}

/* ── Registro — layout amplio ────────────────────────────────── */
.auth-panel.wide { max-width: 680px; }
.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}
@media (max-width: 560px) {
    .auth-grid-2 { grid-template-columns: 1fr; }
    .auth-panel.wide { max-width: 100%; }
}
