/* All login entry points and HTMX steps share this surface. Keep page-specific
   auth styling out of page.css, landing_critical.css and feature stylesheets. */
[data-auth-step] {
    --auth-surface: #fff;
    --auth-field: #f7f8fa;
    --auth-border: #dce1e7;
    box-sizing: border-box;
    width: min(400px, 100%);
    margin-inline: auto;
    padding: 20px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-surface);
    color: var(--ink);
    box-shadow: 0 8px 28px rgba(25, 40, 60, .08);
    font-family: "Noto Sans", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}
html[data-design="blue"] [data-auth-step] {
    --auth-surface: #101c2d;
    --auth-field: #17263b;
    --auth-border: #354459;
}
[data-auth-step] form { margin: 0; }
[data-auth-step] .message,
[data-auth-step] [data-passkey-message] {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
[data-auth-step] .message:empty,
[data-auth-step] [data-passkey-message]:empty { display: none; }
[data-auth-step] .auth-email-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
[data-auth-step] .auth-email-form label { flex: 1; min-width: 0; margin: 0; }
[data-auth-step] .auth-email-form input[type="email"] {
    box-sizing: border-box;
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: var(--auth-field);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
}
[data-auth-step] .auth-email-form input:focus-visible {
    outline: 2px solid var(--action);
    outline-offset: 2px;
}
[data-auth-step] .submit-button {
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--action);
    color: #fff;
    box-shadow: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
[data-auth-step] .auth-email-form .submit-button {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
}
[data-auth-step] .submit-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
[data-auth-step] .auth-email-form .message { flex: 0 0 100%; }
[data-auth-step] .has-message .message,
[data-auth-step] .code-hint { color: #a33d42; }
[data-auth-step] .security-passkey-entry { margin-top: 8px; text-align: center; }
[data-auth-step] .auth-secondary {
    display: inline-block;
    min-height: 36px;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}
[data-auth-step] .auth-secondary:hover { color: var(--action); text-decoration: underline; }
[data-auth-step] .auth-code-form { display: grid; justify-items: center; gap: 14px; }
[data-auth-step] .code-delivery-hint { text-align: center; }
[data-auth-step] .code-boxes {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 36px));
    gap: 6px;
    width: min(246px, 100%);
}
[data-auth-step] .code-box {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    height: 42px;
    min-width: 0;
    border: 1px solid var(--auth-border);
    border-radius: 7px;
    background: var(--auth-field);
    color: var(--ink);
    font: inherit;
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
[data-auth-step] .code-boxes:focus-within .code-box.is-active {
    border-color: var(--action);
    box-shadow: 0 0 0 2px rgba(var(--action-rgb), .18);
}
[data-auth-step] .code-boxes .code-input-native {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    font-size: 16px;
    cursor: text;
}
[data-auth-step] .code-input-native:focus-visible { outline: 0 !important; outline-offset: 0 !important; }
[data-auth-step] .register-consent-form { display: grid; gap: 14px; }
[data-auth-step] h2 { margin: 0; font: inherit; font-weight: 600; }
[data-auth-step] .checkbox-line { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; color: var(--ink); font: inherit; }
[data-auth-step] input[type="checkbox"] { margin-top: 3px; }
[data-auth-step] a { color: var(--action); }
.auth-prompt {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 16px;
    overflow-y: auto;
    background: rgba(25, 35, 45, .12);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.auth-prompt[hidden] { display: none; }
.auth-prompt > [data-auth-step] { max-height: calc(100dvh - 32px); overflow-y: auto; }
body.auth-prompt-open { overflow: hidden; }

.auth-card { width: min(400px, 100%); margin: 28px auto 0; }
