/* Standalone auth stylesheet — hand-authored, intentionally decoupled from the SCSS bundle (styles.css). Not an esbuild entry. */

:root {
    --auth-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --auth-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --auth-bg: #f5f7fa;
    --auth-surface: #ffffff;
    --auth-border: #e3e8ee;
    --auth-border-strong: #cdd5df;
    --auth-text: #1a1f36;
    --auth-text-muted: #697386;
    --auth-text-subtle: #8792a2;
    --auth-accent: #009efb;
    --auth-accent-hover: #0089d8;
    --auth-accent-active: #0077be;
    --auth-accent-contrast: #ffffff;
    --auth-ring: rgba(0, 158, 251, 0.30);
    --auth-danger: #df1b41;
    --auth-danger-bg: #fff0f3;
    --auth-danger-border: #f6ccd5;
    --auth-danger-ring: rgba(223, 27, 65, 0.25);
    --auth-success: #0e7c5a;
    --auth-success-bg: #ecfdf5;
    --auth-success-border: #b7e4cd;
    --auth-warning: #b54708;
    --auth-warning-bg: #fffaeb;
    --auth-warning-border: #f5d59b;
    --auth-info: #0b6fb8;
    --auth-info-bg: #eff8ff;
    --auth-info-border: #b9ddff;
    --auth-radius: 12px;
    --auth-radius-sm: 8px;
    --auth-control-h: 44px;
    --auth-maxw: 400px;
    --auth-shadow-card: 0 0 0 1px rgba(50, 50, 93, 0.06), 0 2px 5px 0 rgba(50, 50, 93, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.05), 0 12px 24px -12px rgba(50, 50, 93, 0.18);
    --auth-shadow-btn: 0 1px 1px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Minimal local reset — auth pages load no other CSS, so scope stays tight. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body.auth-body,
.auth-body h1,
.auth-body p,
.auth-body ul,
.auth-body li,
.auth-body figure {
    margin: 0;
}

.auth-body ul {
    padding: 0;
}

.auth-body img,
.auth-body svg {
    display: block;
}

body.auth-body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    background-color: var(--auth-bg);
    background-image:
        radial-gradient(120% 80% at 50% -10%, rgba(0, 158, 251, 0.08) 0%, rgba(0, 158, 251, 0) 60%),
        linear-gradient(180deg, #ffffff 0%, var(--auth-bg) 38%);
    font-family: var(--auth-font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--auth-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-shell {
    width: 100%;
    max-width: var(--auth-maxw);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.auth-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo {
    max-height: 38px;
    width: auto;
    display: block;
}

.auth-card {
    width: 100%;
    background: var(--auth-surface);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow-card);
    padding: clamp(1.5rem, 5vw, 2.5rem);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-head {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.auth-title {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--auth-text);
}

.auth-subtitle {
    font-size: 0.9375rem;
    color: var(--auth-text-muted);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text);
}

.auth-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.auth-input {
    width: 100%;
    height: var(--auth-control-h);
    padding: 0 0.875rem;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    color: var(--auth-text);
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder {
    color: var(--auth-text-subtle);
}

.auth-input:hover {
    border-color: var(--auth-border-strong);
}

.auth-input:focus,
.auth-input:focus-visible {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px var(--auth-ring);
}

.auth-input.is-invalid {
    border-color: var(--auth-danger);
}

.auth-input.is-invalid:focus,
.auth-input.is-invalid:focus-visible {
    border-color: var(--auth-danger);
    box-shadow: 0 0 0 3px var(--auth-danger-ring);
}

/* OTP / verification code — single centered input, monospace, wide tracking. */
.auth-input--otp {
    height: 52px;
    text-align: center;
    font-family: var(--auth-font-mono);
    font-size: 1.25rem;
    letter-spacing: 0.5em;
    /* The right margin from letter-spacing is rebalanced with matching left indent. */
    padding-right: 0;
    text-indent: 0.5em;
}

.auth-input-group {
    position: relative;
    display: block;
}

/* Leave room so the value never slides under the toggle button. */
.auth-input-group .auth-input {
    padding-right: 3rem;
}

.auth-toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    background: transparent;
    border: none;
    color: var(--auth-text-subtle);
    cursor: pointer;
    border-radius: var(--auth-radius-sm);
    transition: color 0.15s ease, box-shadow 0.15s ease;
}

.auth-toggle:hover {
    color: var(--auth-text-muted);
}

.auth-toggle:focus-visible {
    outline: none;
    color: var(--auth-text-muted);
    box-shadow: 0 0 0 3px var(--auth-ring);
}

.auth-toggle .icon-eye-off {
    display: none;
}

.auth-toggle.is-revealed .icon-eye {
    display: none;
}

.auth-toggle.is-revealed .icon-eye-off {
    display: inline;
}

.auth-btn {
    width: 100%;
    height: var(--auth-control-h);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--auth-accent-contrast);
    background: var(--auth-accent);
    border: 1px solid transparent;
    border-radius: var(--auth-radius-sm);
    box-shadow: var(--auth-shadow-btn);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.auth-btn:hover {
    background: var(--auth-accent-hover);
}

.auth-btn:active {
    background: var(--auth-accent-active);
    transform: translateY(1px);
}

.auth-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--auth-ring), var(--auth-shadow-btn);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-btn--danger {
    color: var(--auth-danger);
    background: transparent;
    border-color: var(--auth-danger-border);
    box-shadow: none;
}

.auth-btn--danger:hover {
    color: var(--auth-danger);
    background: var(--auth-danger-bg);
}

.auth-btn--danger:active {
    background: var(--auth-danger-bg);
}

.auth-btn--danger:focus-visible {
    box-shadow: 0 0 0 3px var(--auth-danger-ring);
}

.auth-btn--secondary {
    color: var(--auth-text);
    background: #fff;
    border-color: var(--auth-border);
    box-shadow: none;
}

.auth-btn--secondary:hover {
    background: #fff;
    border-color: var(--auth-border-strong);
}

.auth-btn--secondary:active {
    background: #fff;
}

.auth-link {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 500;
    border-radius: 4px;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--auth-ring);
}

.auth-link--muted {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--auth-text-muted);
    font-weight: 500;
}

.auth-link--muted:hover {
    color: var(--auth-text);
}

.auth-error {
    color: var(--auth-danger);
    font-size: 0.8125rem;
}

.auth-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-alerts:empty {
    display: none;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid transparent;
    border-radius: var(--auth-radius-sm);
}

.auth-alert__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.auth-alert__body {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.875rem;
    line-height: 1.45;
}

.auth-alert__body ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.auth-alert__body li + li {
    margin-top: 0.25rem;
}

.auth-alert__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    margin: -0.25rem -0.25rem -0.25rem 0;
    padding: 0;
    background: transparent;
    border: none;
    color: currentColor;
    opacity: 0.65;
    cursor: pointer;
    border-radius: 4px;
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.auth-alert__close:hover {
    opacity: 1;
}

.auth-alert__close:focus-visible {
    outline: none;
    opacity: 1;
    box-shadow: 0 0 0 3px var(--auth-ring);
}

.auth-alert__close svg {
    width: 16px;
    height: 16px;
}

.auth-alert--error {
    color: var(--auth-danger);
    background: var(--auth-danger-bg);
    border-color: var(--auth-danger-border);
}

.auth-alert--success {
    color: var(--auth-success);
    background: var(--auth-success-bg);
    border-color: var(--auth-success-border);
}

.auth-alert--warning {
    color: var(--auth-warning);
    background: var(--auth-warning-bg);
    border-color: var(--auth-warning-border);
}

.auth-alert--info {
    color: var(--auth-info);
    background: var(--auth-info-bg);
    border-color: var(--auth-info-border);
}

.auth-secret-key {
    font-family: var(--auth-font-mono);
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    word-break: break-all;
    text-align: center;
    background: #f6f8fb;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    padding: 0.65rem 0.75rem;
    color: var(--auth-text);
    user-select: all;
}

.auth-qr {
    text-align: center;
}

.auth-qr__frame {
    max-width: 200px;
    width: 100%;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    padding: 0.5rem;
}

.auth-qr__frame svg,
.auth-qr__frame img {
    width: 100%;
    height: auto;
}

.auth-stores {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
}

.auth-stores img {
    height: 2.75rem;
    width: auto;
}

.auth-footnote {
    text-align: center;
    color: var(--auth-text-subtle);
    font-size: 0.8125rem;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 44px;
    cursor: pointer;
    color: var(--auth-text-muted);
    font-size: 0.875rem;
    user-select: none;
}

.auth-check__input {
    flex: 0 0 auto;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    accent-color: var(--auth-accent);
    cursor: pointer;
}

.auth-check__input:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 2px;
    border-radius: 3px;
}

.auth-divider {
    width: 100%;
    border: none;
    border-top: 1px solid var(--auth-border);
    margin: 0.25rem 0;
}

.auth-reveal {
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
}

.auth-reveal__summary {
    list-style: none;
    cursor: pointer;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text-muted);
    user-select: none;
}

.auth-reveal__summary::-webkit-details-marker {
    display: none;
}

.auth-reveal__summary::after {
    content: "\203A";
    float: right;
    color: var(--auth-text-subtle);
    transition: transform 0.15s ease;
}

.auth-reveal[open] .auth-reveal__summary::after {
    transform: rotate(90deg);
}

.auth-reveal__summary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--auth-ring);
    border-radius: var(--auth-radius-sm);
}

.auth-reveal__body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 0.875rem 0.875rem;
}

.auth-help {
    margin: 0;
    text-align: center;
    color: var(--auth-text-subtle);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.auth-passkey-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.auth-passkey {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
}

.auth-passkey__meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.auth-passkey__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-text);
    word-break: break-word;
}

.auth-passkey__detail {
    font-size: 0.75rem;
    color: var(--auth-text-subtle);
}

.auth-passkey__remove {
    flex: 0 0 auto;
}

.auth-btn--inline {
    width: auto;
    height: auto;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.auth-devbanner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: var(--auth-danger);
    color: #fff;
    font-weight: 600;
    font-size: 0.8125rem;
    text-align: center;
    padding: 0.35rem;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

@media (forced-colors: active) {
    .auth-card {
        border: 1px solid CanvasText;
    }

    .auth-input,
    .auth-btn,
    .auth-btn--secondary,
    .auth-btn--danger {
        border: 1px solid CanvasText;
    }

    .auth-input:focus,
    .auth-input:focus-visible,
    .auth-btn:focus-visible,
    .auth-btn--secondary:focus-visible,
    .auth-btn--danger:focus-visible,
    .auth-toggle:focus-visible,
    .auth-link:focus-visible,
    .auth-alert__close:focus-visible {
        outline: 2px solid Highlight;
        outline-offset: 2px;
    }
}
