/* Mismos tokens que la capa de diseño de la home
   (hello-elementor-child/css/inicio-modern.css) */
:root {
    --kf-bg: #0a0a0a;
    --kf-surface: #141414;
    --kf-surface-2: #1a1a1a;
    --kf-border: rgba(255, 255, 255, 0.08);
    --kf-border-strong: rgba(255, 255, 255, 0.16);
    --kf-text: #f5f5f5;
    --kf-muted: #a3a3a3;
    /* El acento es el color del plan (kf-tiers.css) */
    --kf-accent: var(--kf-tier, #f2600c);
    --kf-accent-hover: var(--kf-tier-hi, #ff8a3d);
    --kf-accent-soft: color-mix(in srgb, var(--kf-accent) 12%, transparent);
    --kf-danger: #ff8a80;
    --kf-r-sm: 12px;
    --kf-r-md: 16px;
    --kf-r-lg: 24px;
    --kf-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

body {
    font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--kf-bg);
    color: var(--kf-text);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.auth {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---------- Columna del formulario ---------- */
.auth-main {
    display: flex;
    flex-direction: column;
    padding: 16px 24px 32px;
}

.auth-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
}

.logo {
    color: var(--kf-accent);
    font-weight: 800;
    font-size: 1.25rem;
    font-style: italic;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.link-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 4px;
    color: var(--kf-muted);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s var(--kf-ease);
}
.link-back:hover { color: var(--kf-text); }
.link-back svg { width: 18px; height: 18px; }

.auth-top-actions { display: flex; align-items: center; gap: 16px; }

.auth-form-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 48px 0;
}

.eyebrow {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 16px;
    border-radius: 999px;
    background: var(--kf-accent-soft);
    color: var(--kf-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

h1 {
    font-size: clamp(2rem, 1.6rem + 1.6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin-bottom: 8px;
}

.lead {
    color: var(--kf-muted);
    font-size: 1rem;
    margin-bottom: 32px;
}

/* ---------- Error ---------- */
.alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
    margin-bottom: 24px;
    border-radius: var(--kf-r-sm);
    background: rgba(255, 82, 82, 0.08);
    border: 1px solid rgba(255, 82, 82, 0.28);
    color: var(--kf-danger);
    font-size: 0.9375rem;
    line-height: 1.45;
}
.alert svg { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; }

/* ---------- Campos ---------- */
.field { margin-bottom: 16px; }

.field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--kf-text);
}

.field-help {
    font-size: 0.8125rem;
    color: var(--kf-muted);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.24);
    text-underline-offset: 3px;
    transition: color 0.2s var(--kf-ease);
}
.field-help:hover { color: var(--kf-text); }

.control { position: relative; }
/* Campo del @ (como en Instagram): la arroba va fija delante del nombre */
.control--at::before {
    content: "@"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--kf-muted); font-size: 1rem; font-weight: 600; pointer-events: none;
}
.control--at .input { padding-left: 36px; }

.input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    background: var(--kf-surface);
    border: 1px solid var(--kf-border-strong);
    border-radius: var(--kf-r-sm);
    color: var(--kf-text);
    font: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s var(--kf-ease), box-shadow 0.2s var(--kf-ease), background-color 0.2s var(--kf-ease);
}
.input::placeholder { color: #8a8a8a; }
.input:hover { border-color: rgba(255, 255, 255, 0.28); }
.input:focus {
    border-color: var(--kf-accent);
    background: var(--kf-surface-2);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--kf-accent) 18%, transparent);
}
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--kf-text);
    -webkit-box-shadow: 0 0 0 1000px var(--kf-surface) inset;
    caret-color: var(--kf-text);
}
.input[aria-invalid="true"] { border-color: var(--kf-danger); }

.field-error {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    color: var(--kf-danger);
    font-size: 0.875rem;
    line-height: 1.4;
}
.field-error[hidden] { display: none; }

.input-password { padding-right: 56px; }

.toggle-pass {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--kf-muted);
    cursor: pointer;
    transition: color 0.2s var(--kf-ease), background-color 0.2s var(--kf-ease);
}
.toggle-pass:hover { color: var(--kf-text); background: rgba(255, 255, 255, 0.06); }
.toggle-pass svg { width: 20px; height: 20px; }
.toggle-pass .icon-hide { display: none; }
.toggle-pass[aria-pressed="true"] .icon-show { display: none; }
.toggle-pass[aria-pressed="true"] .icon-hide { display: block; }

/* ---------- Botón ---------- */
.btn-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    margin-top: 8px;
    border: 0;
    border-radius: 999px;
    background: var(--kf-accent);
    color: #000;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s var(--kf-ease), transform 0.2s var(--kf-ease);
}
.btn-submit:hover { background: var(--kf-accent-hover); transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }
.btn-submit svg { width: 18px; height: 18px; transition: transform 0.2s var(--kf-ease); }
.btn-submit:hover svg { transform: translateX(2px); }
.btn-submit .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.btn-submit:disabled { cursor: progress; opacity: 0.85; transform: none; }
.btn-submit.is-loading .spinner { display: block; }
.btn-submit.is-loading svg { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--kf-accent);
    outline-offset: 3px;
}

/* ---------- Pie del formulario ---------- */
.divider {
    height: 1px;
    background: var(--kf-border);
    margin: 32px 0 24px;
}

.signup {
    color: var(--kf-muted);
    font-size: 0.9375rem;
    text-align: center;
}
.signup a {
    color: var(--kf-text);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--kf-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}
.signup a:hover { color: var(--kf-accent); }

.auth-foot {
    color: #8a8a8a;
    font-size: 0.8125rem;
    text-align: center;
}

/* ---------- Escritorio: solo el formulario, centrado ---------- */
@media (min-width: 1024px) {
    .auth-main { padding: 24px 48px 32px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
}

/* ---------- Acceso con celular y clave de 5 dígitos ---------- */
.control--phone::before {
    content: "+51"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--kf-muted); font-size: 1rem; font-weight: 600; pointer-events: none;
}
.control--phone .input { padding-left: 54px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.pin { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) 48px; gap: 8px; align-items: center; }
.pin--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.pin .input.pin__box { height: 56px; padding: 0; text-align: center; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pin .toggle-pass { position: static; width: 48px; height: 48px; }
.alert--ok { background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.3); color: #86efac; }
.alt-link { color: var(--kf-muted); font-size: 0.9375rem; margin-top: 18px; text-align: center; }
.alt-link a { color: var(--kf-text); text-decoration: underline; text-underline-offset: 3px; }
.hint { color: var(--kf-muted); font-size: 0.875rem; line-height: 1.5; margin-top: 8px; }
.btn-ghost {
    background: transparent; border: 1px solid var(--kf-border-strong); border-radius: var(--kf-r-sm);
    color: var(--kf-text); cursor: pointer; font: inherit; font-size: 0.9375rem; font-weight: 600;
    margin-top: 12px; min-height: 48px; width: 100%;
}
@media (max-width: 380px) { .pin { gap: 6px; grid-template-columns: repeat(5, minmax(0, 1fr)) 44px; } .pin .input.pin__box { font-size: 1.25rem; } .pin--6 { gap: 6px; } }
.link-btn { background: none; border: 0; color: var(--kf-text); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }

/* Enlaces de ayuda del login («¿Olvidaste tu clave?», «Entra con tu @…»): objetivo táctil de 44 px, no solo la línea de texto */
.alt-link a { align-items: center; display: inline-flex; min-height: 44px; padding-inline: 6px; }
@media (max-width: 340px) { .pin { gap: 4px; } }
@media (max-width: 340px) { .pin:not(.pin--6) { grid-template-columns: repeat(5, minmax(0, 1fr)) 40px; } .pin .toggle-pass { width: 40px; height: 44px; } }
