/* ============================================================
   Acceso (Login / Registro) — rediseño v42
   Layout en dos mitades: panel morado de marca + formulario.
   Tema controlado por html[data-theme="light|dark"] (clave tmx-theme).
   ============================================================ */

html[data-theme="light"], html:not([data-theme]) {
    --cta: #A9448C; --hero: #6A4390; --bg: #F4EDFB; --surface: #FFFFFF;
    --line: #E3D3F3; --border: #D8C4EC; --fg: #3A2D4D; --title: #6A4390;
    --muted: #6B5E80; --btnline: #7A4FA3; --link: #8A2F73;
    --bad-bg: #FDE2E4; --bad-fg: #9B1C2E;
    --panel-fg: #FFFFFF; --panel-soft: #F4EDFB; --panel-line: rgba(255,255,255,.28);
    color-scheme: light;
}
html[data-theme="dark"] {
    --cta: #7F52B8; --hero: #432A6E; --bg: #2A1747; --surface: #37215C;
    --line: #54397F; --border: #6A4E96; --fg: #F3ECFA; --title: #FFFFFF;
    --muted: #CDBBE3; --btnline: #D6B9F0; --link: #E3C4F7;
    --bad-bg: #6B2230; --bad-fg: #FFC9D1;
    --panel-fg: #FFFFFF; --panel-soft: #E8DAF7; --panel-line: rgba(255,255,255,.22);
    color-scheme: dark;
}

html, body { margin: 0; min-height: 100%; }
.au-body {
    font-family: 'Manrope', 'Helvetica Neue', Arial, sans-serif;
    color: var(--fg); background: var(--bg);
}
.au-shell { container-type: inline-size; display: flex; flex-wrap: wrap; align-items: stretch; min-height: 100vh; }

/* ---------- Panel de marca ---------- */
.au-panel {
    flex: 1 1 480px; min-width: 0; box-sizing: border-box;
    padding: 48px clamp(24px, 5cqw, 72px);
    background: var(--hero); color: var(--panel-fg);
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.au-logo-link { display: inline-flex; align-self: flex-start; }
.au-logo { width: 96px; height: 96px; object-fit: contain; }
.au-panel-mid { display: flex; flex-direction: column; gap: 28px; }
.au-hl { margin: 0; font-size: clamp(30px, 3.6cqw, 48px); line-height: 1.15; font-weight: 800; max-width: 460px; }
.au-ben { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 18px; max-width: 460px; }
.au-ben li { display: flex; align-items: flex-start; gap: 14px; }
.au-ben-ico {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
    border: 1.5px solid var(--panel-line); display: inline-flex; align-items: center; justify-content: center;
}
.au-ben li > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.au-ben strong { font-size: 17px; }
.au-ben li > span:last-child > span { font-size: 15px; line-height: 1.5; color: var(--panel-soft); }
.au-panel-foot { margin: 0; font-size: 13px; color: var(--panel-soft); }

/* ---------- Columna del formulario ---------- */
.au-form {
    flex: 1 1 480px; min-width: 0; box-sizing: border-box;
    padding: 24px clamp(24px, 5cqw, 72px) 48px;
    display: flex; flex-direction: column; gap: 24px;
}
.au-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.au-back {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
    font-size: 15px; font-weight: 700; color: var(--title); text-decoration: none;
}
.au-back:hover { text-decoration: underline; }
.au-tema {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0; border-radius: 50%;
    border: 2px solid var(--btnline); background: transparent; color: var(--title); cursor: pointer;
}
.au-tema:hover { background: var(--surface); }
.au-tema .ico-sol { display: none; }
html[data-theme="dark"] .au-tema .ico-luna { display: none; }
html[data-theme="dark"] .au-tema .ico-sol { display: inline; }

.au-center { flex: 1; display: flex; align-items: center; justify-content: center; }
.au-card {
    width: 100%; max-width: 440px; box-sizing: border-box;
    background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
    padding: clamp(24px, 4cqw, 36px);
    display: flex; flex-direction: column; gap: 20px;
}
.au-card-wide { max-width: 520px; }
.au-card form { display: flex; flex-direction: column; gap: 16px; margin: 0; }

.auth-title { margin: 0; font-size: 30px; font-weight: 800; color: var(--title); }
.auth-subtitle { margin: 6px 0 0; font-size: 16px; color: var(--muted); }

/* ---------- Campos ---------- */
.au-row { display: flex; flex-wrap: wrap; gap: 16px; }
.au-row > div { flex: 1 1 200px; min-width: 0; }
.lbl { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--fg); }
.lbl .opt { font-weight: 500; color: var(--muted); }
.auth-input, .form-control.auth-input {
    width: 100%; min-height: 48px; box-sizing: border-box; padding: 0 16px;
    border: 1.5px solid var(--border); border-radius: 14px;
    font: inherit; font-size: 16px; color: var(--fg); background: var(--bg); box-shadow: none;
}
.auth-input:focus, .form-control.auth-input:focus {
    outline: 3px solid var(--btnline); outline-offset: 1px;
    border-color: var(--border); background: var(--bg); color: var(--fg); box-shadow: none;
}
.auth-input.input-validation-error { border-color: var(--bad-fg); }
.au-pass { position: relative; }
.au-pass .auth-input { padding-right: 52px; }
.au-eye {
    position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.au-eye:hover, .au-eye.on { color: var(--title); }
.au-hint { margin: -6px 0 0; font-size: 13px; color: var(--muted); }

.auth-field-error { display: block; margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--bad-fg); }
.auth-field-error:empty { display: none; }
.auth-validation, .alert.auth-validation {
    display: block; margin: 0; padding: 12px 14px; border: 0; border-radius: 14px;
    background: var(--bad-bg); color: var(--bad-fg); font-size: 14px; font-weight: 700; line-height: 1.4;
}
.auth-validation ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none !important; }

.auth-remember { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.au-check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; margin: 0; }
.au-check input { width: 20px; height: 20px; accent-color: var(--cta); margin: 0; }

/* ---------- Botones ---------- */
.btn-auth-login, .btn-auth-register, .btn-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; min-height: 50px; padding: 0 20px; border-radius: 999px;
    font: inherit; font-size: 16px; font-weight: 800; cursor: pointer;
    border: 2px solid transparent; box-sizing: border-box;
}
.btn-auth-login, .btn-auth-register { background: var(--cta); color: #FFFFFF; }
.btn-auth-login:hover, .btn-auth-register:hover { filter: brightness(.92); }
.btn-auth-login:disabled, .btn-auth-register:disabled { opacity: .75; cursor: default; }
.btn-google { background: var(--surface); border-color: var(--border); color: var(--fg); }
.btn-google:hover { background: var(--bg); }

.auth-divider { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-link, .auth-footer a { color: var(--link); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.auth-footer { margin: 0; text-align: center; font-size: 15px; color: var(--muted); }

/* ---------- Móvil / angosto ---------- */
@container (max-width: 860px) {
    .au-shell { min-height: 0; }
    .au-panel { flex: 1 0 100%; min-height: 0; padding: 20px clamp(16px, 5cqw, 32px); gap: 12px; }
    .au-ben { display: none; }
    .au-hl { font-size: 24px; }
    .au-logo { width: 56px; height: 56px; }
    .au-form { flex: 1 0 100%; padding: 24px clamp(16px, 5cqw, 32px) 40px; }
}
