/* =============================================================
   Casitos — pantalla de acceso
   Requiere css/casitos-base.css (tokens, tipografía y botones).
   ============================================================= */

/* El panel de marca es siempre oscuro: es una superficie de marca. */
:root,
html[data-theme="light"] { --cs-panel: #101728; }
html[data-theme="dark"]  { --cs-panel: #101422; }

/* ---------- estructura ---------- */
.cs-auth {
    min-height: 100vh;
    display: grid;
}

.cs-auth__form {
    display: flex;
    flex-direction: column;
    padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1.25rem, 4vw, 3rem);
    background: var(--cs-paper);
}

.cs-auth__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cs-auth__bar-right {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.cs-auth__back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    font-weight: 500;
    color: var(--cs-ink-soft);
    text-decoration: none;
    transition: color .18s ease;
}

.cs-auth__back:hover { color: var(--cs-teal-ink); }

.cs-auth__box {
    width: 100%;
    max-width: 25.5rem;
    margin: auto;
    padding-block: clamp(2rem, 5vh, 3.25rem);
}

/* ---------- pestañas ---------- */
.cs-tabs {
    display: flex;
    gap: 1.75rem;
    margin-bottom: 1.9rem;
    border-bottom: 1px solid var(--cs-line);
}

.cs-tab {
    padding: 0 0 .75rem;
    margin-bottom: -1px;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    font-size: .94rem;
    font-weight: 600;
    color: var(--cs-ink-faint);
    cursor: pointer;
    transition: color .18s ease, border-color .18s ease;
}

.cs-tab:hover { color: var(--cs-ink-soft); }

.cs-tab.is-on {
    color: var(--cs-ink);
    border-bottom-color: var(--cs-teal);
}

.cs-pane[hidden] { display: none; }

/* ---------- encabezado del formulario ---------- */
.cs-auth__h {
    font-family: Spectral, Georgia, serif;
    font-size: clamp(1.6rem, 3vw, 1.95rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.018em;
    color: var(--cs-ink);
}

.cs-auth__p {
    margin-top: .5rem;
    margin-bottom: 1.6rem;
    font-size: .94rem;
    line-height: 1.6;
    color: var(--cs-ink-soft);
}

/* ---------- campos ---------- */
.cs-field { margin-bottom: 1.05rem; }

.cs-label {
    display: block;
    margin-bottom: .4rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--cs-ink-soft);
}

.cs-control { position: relative; }

.cs-input {
    width: 100%;
    height: 46px;
    padding: 0 .95rem;
    border: 1px solid var(--cs-line);
    border-radius: 10px;
    background: var(--cs-surface-2);
    color: var(--cs-ink);
    font-size: .95rem;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.cs-input::placeholder { color: var(--cs-ink-faint); }

.cs-input:focus {
    outline: none;
    border-color: var(--cs-teal);
    box-shadow: 0 0 0 3px var(--cs-tint-teal);
}

.cs-control--pass .cs-input { padding-right: 2.9rem; }

.cs-eye {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--cs-ink-faint);
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease;
}

.cs-eye:hover {
    color: var(--cs-ink);
    background: var(--cs-tint-teal);
}

.cs-eye .icon-off { display: none; }
.cs-eye.is-on .icon-on  { display: none; }
.cs-eye.is-on .icon-off { display: block; }

.cs-input.is-bad { border-color: #c0483c; }
html[data-theme="dark"] .cs-input.is-bad { border-color: #e8776a; }

.cs-err {
    margin-top: .4rem;
    font-size: .8rem;
    line-height: 1.4;
    color: #b84034;
}

html[data-theme="dark"] .cs-err { color: #e8776a; }

/* ---------- fila de acciones ---------- */
.cs-auth__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.4rem;
}

.cs-check {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-size: .88rem;
    color: var(--cs-ink-soft);
    cursor: pointer;
    user-select: none;
}

.cs-check input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--cs-teal);
    cursor: pointer;
}

.cs-auth__submit { width: 100%; justify-content: center; margin-top: 1.4rem; }

.cs-auth__nota {
    margin-top: 1.25rem;
    font-size: .82rem;
    line-height: 1.55;
    color: var(--cs-ink-faint);
}

/* ---------- avisos ---------- */
.cs-alert {
    margin-bottom: 1.1rem;
    padding: .75rem .9rem;
    border: 1px solid;
    border-radius: 10px;
    font-size: .88rem;
    line-height: 1.55;
}

.cs-alert--bad {
    background: rgba(192, 72, 60, .07);
    border-color: rgba(192, 72, 60, .28);
    color: #a5382d;
}

.cs-alert--ok {
    background: var(--cs-tint-green);
    border-color: rgba(42, 143, 92, .28);
    color: var(--cs-green);
}

html[data-theme="dark"] .cs-alert--bad {
    background: rgba(232, 119, 106, .1);
    border-color: rgba(232, 119, 106, .3);
    color: #f0a099;
}

/* ---------- panel de marca ---------- */
.cs-auth__panel { display: none; }

@media (min-width: 900px) {
    .cs-auth { grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); }

    .cs-auth__panel {
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 2.75rem;
        padding: clamp(2.5rem, 4vw, 3.5rem);
        background: var(--cs-panel);
        border-left: 1px solid var(--cs-line);
        color: #fff;
        overflow: hidden;
    }
}

.cs-auth__panel::before {
    content: "";
    position: absolute;
    top: -16rem;
    right: -14rem;
    width: 42rem;
    height: 42rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(75, 195, 208, .16) 0%, transparent 66%);
    pointer-events: none;
}

.cs-panel__top { position: relative; }

.cs-panel__eyebrow {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #4bc3d0;
}

.cs-panel__claim {
    margin-top: 1.1rem;
    font-family: Spectral, Georgia, serif;
    font-size: clamp(2rem, 3.4vw, 2.7rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -.02em;
    color: #fff;
}

.cs-panel__claim em { font-style: italic; }
.cs-panel__claim .cs-stop { color: #4bc3d0; }

.cs-panel__p {
    margin-top: 1rem;
    max-width: 26rem;
    font-size: .95rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, .68);
}

/* Riel vertical de etapas: mismo recurso que la portada, en vertical */
.cs-rail-v { position: relative; }

.cs-rail-v li {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding-bottom: 1.6rem;
}

.cs-rail-v li:last-child { padding-bottom: 0; }

.cs-rail-v li:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 38px;
    bottom: .35rem;
    width: 1px;
    background: rgba(255, 255, 255, .16);
}

.cs-rail-v__n {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .07);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: .7rem;
    font-weight: 600;
    color: #4bc3d0;
}

.cs-rail-v__t {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    padding-top: .3rem;
}

.cs-rail-v__d {
    margin-top: .25rem;
    font-size: .87rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, .6);
}

.cs-panel__foot {
    position: relative;
    margin-top: 1rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: .74rem;
    line-height: 1.6;
    letter-spacing: .03em;
    color: rgba(255, 255, 255, .55);
}

.cs-panel__foot a {
    color: #4bc3d0;
    text-decoration: none;
}

.cs-panel__foot a:hover { text-decoration: underline; }
