/* ============================================================
   IniciodeSesion.css — Sistema DMDI
   Ruta: public/css/IniciodeSesion.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600&display=swap');

/* ── RESET & VARIABLES ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --white:   #ffffff;
    --off:     #f5f7fa;
    --light:   #e8edf5;
    --muted:   #8a97ab;
    --text:    #1c2333;
    --accent:  #2563eb;
    --acc2:    #0ea5e9;
    --error:   #ef4444;
    --success: #10b981;
}
html[data-theme="dark"] {
    --white:   #111827;
    --off:     #020617;
    --light:   #1e293b;
    --muted:   #94a3b8;
    --text:    #e5e7eb;
    --accent:  #60a5fa;
    --acc2:    #38bdf8;
    --error:   #f87171;
    --success: #34d399;
}
html[data-theme="dark"] body {
    background: var(--off);
    color: var(--text);
}

html[data-theme="dark"] .divider {
    background: rgba(148,163,184,.18);
}

html[data-theme="dark"] .form-card {
    background: rgba(15,23,42,.92);
    border: 1px solid rgba(148,163,184,.18);
    box-shadow: 0 18px 40px rgba(0,0,0,.35);
}

html[data-theme="dark"] .input-wrap {
    background: rgba(17,24,39,.95);
    border-color: rgba(148,163,184,.18);
}

html[data-theme="dark"] .input-wrap input {
    background: transparent;
    color: var(--text);
}

html[data-theme="dark"] .input-wrap input::placeholder {
    color: var(--muted);
}

html[data-theme="dark"] .form-title,
html[data-theme="dark"] .logo-name,
html[data-theme="dark"] .greeting-title,
html[data-theme="dark"] .estado-display,
html[data-theme="dark"] .field label {
    color: var(--text);
}

html[data-theme="dark"] .form-sub,
html[data-theme="dark"] .greeting-sub,
html[data-theme="dark"] .left-footer,
html[data-theme="dark"] .logo-label,
html[data-theme="dark"] .greeting-time,
html[data-theme="dark"] .estado-badge {
    color: var(--muted);
}

html[data-theme="dark"] .alert-error {
    background: rgba(127,29,29,.22);
    border-color: rgba(248,113,113,.28);
    color: #fecaca;
}

html[data-theme="dark"] .estado-display {
    background: rgba(245,158,11,.12) !important;
    border-color: rgba(245,158,11,.25) !important;
    color: #fcd34d !important;
}

html[data-theme="dark"] .toggle-pw {
    color: var(--muted);
}
html, body {
    height: 100%;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--off);
    color: var(--text);
    overflow: hidden;
}

/* ── CANVAS ── */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ── DECORATIVOS ── */
.deco {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}
.deco-1 {
    width: 600px; height: 600px;
    right: -180px; top: -180px;
    background: radial-gradient(circle, rgba(37,99,235,.06) 0%, transparent 70%);
}
.deco-2 {
    width: 400px; height: 400px;
    left: -120px; bottom: -120px;
    background: radial-gradient(circle, rgba(14,165,233,.05) 0%, transparent 70%);
}

/* ════════════════════════════════
   LAYOUT PRINCIPAL — dos columnas
   ════════════════════════════════ */
#page {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    align-items: stretch;
}

/* ════════════════════════════════
   PANEL IZQUIERDO
   ════════════════════════════════ */
.left-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 3rem;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity .8s ease, transform .8s ease;
}
.left-panel.show {
    opacity: 1;
    transform: translateX(0);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: .9rem;
}
.logo-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--acc2));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.logo-icon svg { width: 20px; height: 20px; }
.logo-label {
    font-size: .68rem; font-weight: 500;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--muted);
}
.logo-name { font-size: .9rem; font-weight: 600; }

/* Greeting */
.greeting {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.2rem;
}

.greeting-time {
    font-size: .68rem; font-weight: 500;
    letter-spacing: .2em; text-transform: uppercase;
    color: var(--accent);
    display: inline-flex; align-items: center; gap: .5rem;
    opacity: 0;
    animation: upIn .6s ease .3s forwards;
}
.greeting-time .line-acc {
    width: 20px; height: 1px;
    background: var(--accent);
    display: inline-block;
    flex-shrink: 0;
}

.greeting-title {
    font-size: clamp(2rem, 3.8vw, 3rem);
    font-weight: 200;
    line-height: 1.15;
}
.greeting-title .ln {
    display: block;
    opacity: 0;
    transform: translateY(24px);
}
.greeting-title .ln:nth-child(1) { animation: upIn .7s ease .4s forwards; }
.greeting-title .ln:nth-child(2) { animation: upIn .7s ease .55s forwards; }
.greeting-title b {
    font-weight: 600;
    background: linear-gradient(90deg, var(--accent), var(--acc2));
    -webkit-background-clip: text;
     background-clip: text;
}

.greeting-sub {
    font-size: .82rem; font-weight: 300;
    line-height: 1.7; color: var(--muted);
    max-width: 320px;
    opacity: 0;
    animation: upIn .6s ease .7s forwards;
}

/* Badge estado */
.estado-badge {
    display: inline-flex; align-items: center; gap: .55rem;
    font-size: .72rem; font-weight: 500; color: var(--success);
    background: rgba(16,185,129,.08);
    border: 1px solid rgba(16,185,129,.2);
    border-radius: 99px; padding: .4rem .9rem;
    width: fit-content;
    opacity: 0;
    animation: upIn .6s ease .85s forwards;
}
.estado-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16,185,129,.2);
    animation: pulse-dot 2s ease infinite;
    flex-shrink: 0;
}

/* Left footer */
.left-footer {
    font-size: .64rem; color: var(--muted);
    letter-spacing: .05em;
    opacity: 0;
    animation: upIn .5s ease 1.1s forwards;
}

/* ════════════════════════════════
   DIVIDER VERTICAL
   ════════════════════════════════ */
.divider {
    background: linear-gradient(
        to bottom,
        transparent,
        var(--light) 20%,
        var(--light) 80%,
        transparent
    );
    opacity: 0;
    animation: upIn .5s ease .2s forwards;
}

/* ════════════════════════════════
   PANEL DERECHO — Formulario
   ════════════════════════════════ */
.right-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 3rem;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .8s ease .15s, transform .8s ease .15s;
}
.right-panel.show {
    opacity: 1;
    transform: translateX(0);
}

.form-card {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.form-header { display: flex; flex-direction: column; gap: .4rem; }
.form-title  { font-size: 1.1rem; font-weight: 600; letter-spacing: -.01em; }
.form-sub    { font-size: .78rem; font-weight: 300; color: var(--muted); }

/* ── Campos ── */
.fields { display: flex; flex-direction: column; gap: 1rem; }

.field { display: flex; flex-direction: column; gap: .45rem; }
.field label {
    font-size: .68rem; font-weight: 500;
    letter-spacing: .09em; text-transform: uppercase;
    color: var(--muted);
}

.input-wrap {
    position: relative;
    display: flex; align-items: center;
}
.input-wrap > svg {
    position: absolute; left: .9rem;
    width: 15px; height: 15px;
    color: var(--muted); pointer-events: none;
}
.input-wrap input {
    width: 100%;
    padding: .75rem .9rem .75rem 2.5rem;
    border: 1px solid var(--light);
    border-radius: 10px;
    background: var(--white);
    font-family: inherit;
    font-size: .85rem; font-weight: 400;
    color: var(--text);
    outline: none;
    transition: border-color .25s, box-shadow .25s;
}
.input-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.input-wrap input::placeholder { color: #bcc5d3; }

/* Toggle password */
.toggle-pw {
    position: absolute; right: .9rem;
    background: none; border: none; cursor: pointer;
    color: var(--muted); padding: 0;
    display: flex; align-items: center;
    transition: color .2s;
}
.toggle-pw:hover { color: var(--accent); }
.toggle-pw svg { width: 15px; height: 15px; }

/* ── Campo Estado ── */
.estado-field { display: flex; flex-direction: column; gap: .45rem; }
.estado-field label {
    font-size: .68rem; font-weight: 500;
    letter-spacing: .09em; text-transform: uppercase;
    color: var(--muted);
}
.estado-display {
    display: flex; align-items: center; gap: .7rem;
    padding: .75rem .9rem;
    border: 1px solid rgba(16,185,129,.3);
    border-radius: 10px;
    background: rgba(16,185,129,.04);
    font-size: .85rem; font-weight: 500;
    color: var(--success);
}
.estado-display-dot {
    width: 8px; height: 8px;
    border-radius: 50%; background: var(--success);
    box-shadow: 0 0 0 3px rgba(16,185,129,.2);
    animation: pulse-dot 2s ease infinite;
    flex-shrink: 0;
}

/* ── Botón login ── */
.btn-login {
    width: 100%; padding: .82rem;
    border-radius: 10px; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--acc2));
    color: #fff; font-family: inherit;
    font-size: .85rem; font-weight: 500; letter-spacing: .04em;
    box-shadow: 0 4px 20px rgba(37,99,235,.3);
    transition: box-shadow .3s, transform .25s;
    display: flex; align-items: center; justify-content: center; gap: .6rem;
}
.btn-login:hover {
    box-shadow: 0 8px 28px rgba(37,99,235,.45);
    transform: translateY(-1px);
}
.btn-login:active { transform: translateY(0); }
.btn-login svg { width: 15px; height: 15px; }

/* ── Alerta error ── */
.alert-error {
    display: none; align-items: center; gap: .6rem;
    padding: .7rem .9rem; border-radius: 8px;
    background: rgba(239,68,68,.06);
    border: 1px solid rgba(239,68,68,.2);
    font-size: .78rem; color: var(--error);
}
.alert-error.show { display: flex; }
.alert-error svg  { width: 14px; height: 14px; flex-shrink: 0; }

/* ════════════════════════════════
   KEYFRAMES
   ════════════════════════════════ */
@keyframes upIn {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
    50%       { box-shadow: 0 0 0 6px rgba(16,185,129,.08); }
}
