/* Nocturnas.cl — Fase II / L0D0A */
:root {
    --background: #0A0B0E;
    --surface: #151922;
    --surface-soft: #1B202A;
    --border: #2B3038;
    --border-strong: #454B55;
    --text: #F7F0E4;
    --text-soft: #C8BEB1;
    --text-muted: #8F8982;
    --burgundy: #6B2435;
    --copper: #D19A6E;
    --copper-bright: #E5B189;
    --danger: #FF4D5E;
    --success: #39FF88;
}

* { box-sizing: border-box; }

html { background: var(--background); }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(10, 11, 14, .30), rgba(10, 11, 14, .30)),
        url("/static/catalog/images/catalog-bg-veil-red.d627428a3d2b.png") center / cover no-repeat;
    opacity: .58;
}

button, input, select, textarea { font: inherit; }

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(calc(100% - 32px), 540px);
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    place-items: center;
    padding: 48px 0;
}

.auth-card {
    width: 100%;
    padding: 32px;
    border: 1px solid rgba(77, 83, 94, .72);
    border-radius: 22px;
    background: rgba(15, 17, 22, .97);
    box-shadow: 0 28px 72px rgba(0, 0, 0, .44);
}

.auth-card-wide { width: min(820px, 100%); }

.auth-brand {
    display: inline-flex;
    color: var(--text);
    font-family: "Playfair Display", Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

.auth-progress {
    margin-top: 27px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.auth-progress span {
    padding: 7px 8px;
    border-bottom: 2px solid rgba(77, 83, 94, .55);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
    text-align: center;
}

.auth-progress .is-active {
    border-color: var(--copper-bright);
    color: var(--text);
}

.auth-progress .is-done {
    border-color: rgba(209, 154, 110, .55);
    color: var(--copper);
}

.auth-heading { margin-top: 34px; }

.auth-overline {
    margin-bottom: 10px;
    color: var(--copper);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.auth-heading h1 {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(34px, 8vw, 42px);
    line-height: 1.03;
    font-weight: 600;
    letter-spacing: -.025em;
}

.auth-heading p {
    margin: 14px 0 0;
    color: var(--text-soft);
    font-size: 16px;
    line-height: 1.55;
}

.auth-form {
    margin-top: 27px;
    display: grid;
    gap: 17px;
}

.auth-password-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-field { display: grid; gap: 7px; }

.auth-field > span,
.verification-label {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 650;
}

.auth-field > small {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.auth-field input:not([type="checkbox"]),
.auth-field select,
.auth-field textarea {
    width: 100%;
    min-height: 45px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: var(--surface-soft);
    color: var(--text);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.auth-field textarea { min-height: 110px; padding-top: 11px; }

.auth-field input:focus,
.auth-field select:focus,
.auth-field textarea:focus {
    border-color: rgba(229, 177, 137, .60);
    box-shadow: 0 0 0 3px rgba(209, 154, 110, .08);
}

.auth-consents {
    padding: 14px;
    display: grid;
    gap: 11px;
    border: 1px solid rgba(77, 83, 94, .55);
    border-radius: 11px;
    background: rgba(21, 25, 34, .62);
}

.auth-check {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 9px;
    align-items: start;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.4;
}

.auth-check input { margin: 2px 0 0; accent-color: var(--burgundy); }

.field-error {
    color: var(--danger);
    font-size: 12px;
}

.auth-submit {
    min-height: 46px;
    margin-top: 3px;
    padding: 0 14px;
    border: 1px solid rgba(229, 177, 137, .36);
    border-radius: 10px;
    background: linear-gradient(180deg, #7B2C40, var(--burgundy));
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
    transition: transform 140ms ease, filter 140ms ease, border-color 140ms ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    border-color: rgba(229, 177, 137, .56);
}

.auth-back {
    margin-top: 22px;
    display: inline-block;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
}
.auth-back:hover { color: var(--text-soft); }

.auth-error,
.auth-message {
    margin-top: 20px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 77, 94, .64);
    border-radius: 10px;
    background: rgba(107, 36, 53, .18);
    color: #F4C7C9;
    font-size: 14px;
}

.auth-message-success {
    border-color: rgba(57, 255, 136, .58);
    background: rgba(57, 255, 136, .10);
    color: #CFE0D1;
}

.auth-message-info {
    border-color: rgba(209, 154, 110, .30);
    background: rgba(209, 154, 110, .07);
    color: var(--text-soft);
}

.verification-list {
    margin-top: 25px;
    display: grid;
    gap: 12px;
}

.verification-card {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(21, 25, 34, .78);
}

.verification-card.is-complete {
    border-color: rgba(57, 255, 136, .58);
}

.verification-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 15px;
}

.verification-head > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.verification-head strong {
    overflow-wrap: anywhere;
    font-size: 15px;
    font-weight: 600;
}

.verification-status {
    padding: 4px 7px;
    border: 1px solid rgba(209,154,110,.26);
    border-radius: 999px;
    color: var(--copper);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.is-complete .verification-status {
    border-color: rgba(57, 255, 136, .58);
    color: var(--success);
}

.verification-form {
    margin-top: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    align-items: end;
}

.verification-form .auth-submit {
    min-width: 140px;
    margin: 0;
}

.verification-resend { margin-top: 8px; }

.auth-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}
.auth-link-button:hover { color: var(--copper-bright); }

.auth-footnote {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid rgba(77,83,94,.45);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.auth-logout-form { margin-top: 14px; }

/* Existing account/security surfaces */
.auth-section {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.auth-section-heading { display: grid; gap: 7px; }
.auth-section-heading h2 { margin: 0; font-family: "Playfair Display", Georgia, serif; font-size: 21px; }
.auth-section-heading p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.auth-section-heading-actions { grid-template-columns: 1fr auto; align-items: end; gap: 16px; }
.auth-section-danger { border-top-color: rgba(233,149,156,.28); }
.session-list { margin-top: 18px; display: grid; gap: 10px; }
.session-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center;
    padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft);
}
.session-current { border-color: rgba(209,154,110,.40); }
.session-main { min-width: 0; display: grid; gap: 6px; }
.session-title { font-size: 15px; font-weight: 700; }
.session-meta { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.session-badge {
    margin-left: 6px; padding: 3px 7px; border-radius: 999px;
    background: rgba(209,154,110,.09); color: var(--copper-bright);
    font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em;
}
.auth-secondary {
    min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
    background: transparent; color: var(--text-soft); cursor: pointer;
}
.auth-secondary:hover { border-color: rgba(229,177,137,.45); }
.auth-secondary-danger { color: #EFB2B6; }

@media (max-width: 700px) {
    .auth-section-heading-actions,
    .session-row { grid-template-columns: 1fr; align-items: stretch; }
    .session-row .auth-secondary,
    .auth-section-heading-actions .auth-secondary { width: 100%; }
}

@media (max-width: 560px) {
    .auth-shell { width: min(calc(100% - 20px), 540px); padding: 24px 0; }
    .auth-card { padding: 22px; border-radius: 17px; }
    .auth-heading { margin-top: 28px; }
    .auth-password-grid { grid-template-columns: 1fr; }
    .verification-form { grid-template-columns: 1fr; }
    .verification-form .auth-submit { width: 100%; }
}


/* L0D0D — estados semánticos de alto contraste */
.auth-error,
.auth-message-error {
    color: var(--danger);
    background: rgba(255,77,94,.10);
    border-color: rgba(255,77,94,.64);
    box-shadow: 0 0 18px rgba(255,77,94,.08);
}

.auth-message-success {
    color: var(--success);
    background: rgba(57,255,136,.10);
    border-color: rgba(57,255,136,.58);
    box-shadow: 0 0 18px rgba(57,255,136,.07);
}

.field-error {
    color: var(--danger);
    font-weight: 700;
}


/* 2026-09-25 — contraseña: requisitos, error visible y mostrar/ocultar */
.password-input-wrap {
    position: relative;
    display: block;
}
.password-input-wrap input {
    padding-right: 48px !important;
}
.password-visibility {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 34px;
    height: 34px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}
.password-visibility span,
.password-visibility span::after {
    position: absolute;
    content: "";
}
.password-visibility span {
    left: 7px;
    top: 10px;
    width: 18px;
    height: 12px;
    border: 1.8px solid var(--text-soft);
    border-radius: 50% / 60%;
}
.password-visibility span::after {
    left: 5px;
    top: 2px;
    width: 5px;
    height: 5px;
    border: 1.5px solid var(--text-soft);
    border-radius: 50%;
}
.password-visibility[aria-pressed="true"] span::before {
    position: absolute;
    content: "";
    left: -2px;
    top: 4px;
    width: 22px;
    height: 2px;
    background: var(--danger);
    transform: rotate(-42deg);
    transform-origin: center;
}
.password-visibility:focus-visible {
    outline: 2px solid var(--copper-bright);
    outline-offset: 1px;
}
.auth-field.has-error .password-input-wrap input {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(255,77,94,.10);
}
.auth-field .field-error {
    padding: 7px 9px;
    border: 1px solid rgba(255,77,94,.45);
    border-radius: 8px;
    background: rgba(255,77,94,.09);
    color: var(--danger);
    font-weight: 700;
}
.auth-field-label {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 650;
}


/* 2026-09-26 — alineación estable de contraseña y control de visibilidad */
.auth-password-grid { align-items: start; }
.auth-password-grid .auth-field { grid-template-rows: auto 45px auto; align-content: start; }
.auth-password-grid .password-input-wrap { height: 45px; min-height: 45px; font-size: inherit; font-weight: inherit; }
.auth-password-grid .password-input-wrap input { height: 45px; min-height: 45px; }
.auth-password-grid .password-visibility { top: 22.5px; transform: translateY(-50%); display: grid; place-items: center; }
.auth-password-grid .password-visibility span { position: relative; left: auto; top: auto; display: block; }
