/* ============================================================
   TimsConecta — acceso «ejecutivo» (2026-10-16)
   Panel de marca en grafito a la izquierda (firma, fecha, una frase)
   y el formulario sobre blanco a la derecha. Lo usan login_access,
   auth_forgot_password, auth_password_action y two_factor; el panel
   vive en components/_auth_brand.html.
   ============================================================ */
@import url('fonts.css');

:root {
    --auth-ink: #3f2021;
    --auth-ink-2: #5e4744;
    --auth-ink-3: #7a645e;
    --auth-hairline: #ebdfd4;
    --auth-sunk: #f7f6f5;
    --auth-red: #c8102e;
    --auth-red-hover: #b00e28;
    --auth-night: #141315;
    color-scheme: light;
}

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

html,
body { margin: 0; min-height: 100%; }

body {
    font-family: 'Brewed', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--auth-ink);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:focus-visible { outline: 2px solid var(--auth-red); outline-offset: 2px; }

.auth {
    display: grid;
    grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
    min-height: 100svh;
}

/* ── Panel de marca ── */
.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: 48px 56px 44px;
    background: var(--auth-night);
    color: #ffffff;
}

.auth-leaf {
    position: absolute;
    right: -170px;
    bottom: -230px;
    width: 520px;
    height: auto;
    opacity: .05;
    pointer-events: none;
    user-select: none;
}

.auth-brand-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-lockup { display: flex; align-items: center; gap: 14px; }
.auth-lockup > img { display: block; width: 118px; height: auto; }
.auth-lockup > i { width: 1px; height: 22px; background: rgba(255, 255, 255, .24); }
.auth-lockup > b { font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, .9); }

.auth-date {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
}

.auth-statement { position: relative; max-width: 480px; }

.auth-statement > h2 {
    margin: 0;
    font-size: 44px;
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -.025em;
    text-wrap: balance;
}

.auth-statement > h2 > em { display: block; font-style: normal; color: rgba(255, 255, 255, .48); }

.auth-statement > p {
    margin: 20px 0 0;
    max-width: 400px;
    font-size: 16px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .66);
}

.auth-areas {
    display: flex;
    flex-wrap: wrap;
    row-gap: 6px;
    margin: 36px 0 0;
    padding: 18px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .14);
    list-style: none;
}

.auth-areas > li {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .58);
}

.auth-areas > li + li::before { content: '·'; margin: 0 10px; color: rgba(255, 255, 255, .3); }

.auth-legal { position: relative; margin: 0; font-size: 12px; color: rgba(255, 255, 255, .46); }

/* ── Formulario ── */
.auth-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 44px 56px 40px;
    background: #ffffff;
}

.auth-back {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--auth-ink-2);
    text-decoration: none;
    transition: background-color .15s, color .15s;
}

.auth-back:hover { background: var(--auth-sunk); color: var(--auth-ink); }
.auth-back > svg { width: 15px; height: 15px; }

.auth-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.auth-form { width: 100%; max-width: 380px; }

.auth-form > h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.02em;
}

.auth-sub { margin: 8px 0 28px; font-size: 15px; color: var(--auth-ink-2); }

/* Avisos del servidor: un tinte suave con su icono, nunca un bloque de color fuerte. */
.auth-feedback {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 20px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
}

.auth-feedback::before {
    content: '';
    flex: none;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    background: currentColor;
    -webkit-mask: var(--auth-icon) no-repeat center / contain;
    mask: var(--auth-icon) no-repeat center / contain;
}

.auth-feedback-error {
    background: #fbeef0;
    color: #9b0c24;
    --auth-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
}

.auth-feedback-warning {
    background: #fbf3e6;
    color: #7a4d00;
    --auth-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
}

.auth-feedback-success {
    background: #ecf5ef;
    color: #1f5a37;
    --auth-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.auth-feedback-info {
    background: var(--auth-sunk);
    color: var(--auth-ink-2);
    --auth-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

.auth-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 50px;
    border: 1px solid var(--auth-hairline);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(25, 25, 28, .05);
    font-size: 15px;
    font-weight: 700;
    color: var(--auth-ink);
    text-decoration: none;
    transition: border-color .15s, background-color .15s;
}

.auth-google:hover { border-color: #cfccc8; background: #fcfbfa; }
.auth-google > svg { width: 18px; height: 18px; }

.auth-hint { margin: 10px 0 0; font-size: 12.5px; text-align: center; color: var(--auth-ink-3); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 28px 0 24px;
    font-size: 12px;
    color: var(--auth-ink-3);
}

.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--auth-hairline); }

.auth-fields { margin: 0; }

.auth-field { display: grid; gap: 8px; margin-bottom: 18px; }

.auth-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.auth-field label,
.auth-label { font-size: 13px; font-weight: 700; color: var(--auth-ink); }

.auth-row > a { font-size: 13px; color: var(--auth-ink-2); text-decoration: none; }
.auth-row > a:hover { color: var(--auth-red); text-decoration: underline; text-underline-offset: 3px; }

.auth-input { position: relative; }

.auth-input > input {
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid var(--auth-hairline);
    border-radius: 12px;
    background: #ffffff;
    font: inherit;
    font-size: 15px;
    color: var(--auth-ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.auth-input > input::placeholder { color: #a8a6a3; }
.auth-input > input:focus { border-color: var(--auth-ink); box-shadow: 0 0 0 3px rgba(25, 25, 28, .08); }
.auth-input.has-toggle > input { padding-right: 92px; }

.auth-input > .auth-otp {
    height: 56px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .32em;
    text-align: center;
}

.auth-input > .auth-otp::placeholder { font-size: 15px; font-weight: 400; letter-spacing: 0; }

.auth-show {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    min-width: 72px;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--auth-ink-2);
    cursor: pointer;
}

.auth-show:hover { background: var(--auth-sunk); color: var(--auth-ink); }

.turnstile-wrap { display: flex; justify-content: center; margin: 4px 0 14px; }

.auth-submit {
    width: 100%;
    height: 50px;
    margin-top: 10px;
    border: 0;
    border-radius: 12px;
    background: var(--auth-red);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: background-color .15s;
}

.auth-submit:hover { background: var(--auth-red-hover); }
.auth-submit-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.auth-submit:active,
.auth-google:active { transform: scale(.985); }

.auth-link { margin: 22px 0 0; font-size: 14px; text-align: center; color: var(--auth-ink-2); }
.auth-link > a { color: var(--auth-ink); font-weight: 700; text-decoration: none; }
.auth-link > a:hover { color: var(--auth-red); text-decoration: underline; text-underline-offset: 3px; }

.auth-requirements {
    margin: 2px 0 8px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--auth-sunk);
    font-size: 13px;
    color: var(--auth-ink-2);
}

.auth-requirements > p { margin: 0 0 6px; font-weight: 700; color: var(--auth-ink); }
.auth-requirements > ul { margin: 0; padding-left: 18px; line-height: 1.6; }

.auth-qr {
    display: flex;
    justify-content: center;
    margin: 0 0 18px;
    padding: 18px;
    border: 1px solid var(--auth-hairline);
    border-radius: 16px;
}

.auth-qr > img { display: block; width: 180px; height: 180px; }

.auth-note { margin: 0 0 8px; font-size: 13px; color: var(--auth-ink-2); }

.auth-key {
    margin: 0 0 22px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--auth-sunk);
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 14px;
    letter-spacing: .06em;
    text-align: center;
    word-break: break-all;
    user-select: all;
}

.auth-copy { margin: 0; font-size: 12px; text-align: center; color: var(--auth-ink-3); }

/* ── Teléfono: la marca arriba, compacta; el formulario primero ── */
@media (max-width: 900px) {
    .auth { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .auth-brand { gap: 22px; padding: 28px 24px; }
    .auth-leaf { right: -90px; bottom: -150px; width: 300px; opacity: .06; }
    .auth-lockup > img { width: 100px; }
    .auth-lockup > b { font-size: 14px; }
    .auth-statement > h2 { font-size: 27px; line-height: 1.1; }
    .auth-statement > p,
    .auth-areas,
    .auth-legal,
    .auth-date { display: none; }
    .auth-panel { padding: 12px 24px 28px; }
    .auth-back { min-height: 44px; }
    .auth-center { align-items: flex-start; padding: 8px 0 28px; }
    .auth-form > h1 { font-size: 26px; }
    .auth-sub { margin-bottom: 22px; }
    .auth-input > input { font-size: 16px; }
    .auth-show { height: 44px; right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
    .auth-submit:active,
    .auth-google:active { transform: none; }
}
