/* Leptir auth & onboarding — zinc palette, matches profile_new */

:root {
    --zinc-950: #09090b;
    --zinc-900: #18181b;
    --zinc-800: #27272a;
    --zinc-700: #3f3f46;
    --zinc-500: #71717a;
    --zinc-400: #a1a1aa;
    --zinc-200: #e4e4e7;
    --zinc-100: #f4f4f5;

    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-ring: rgba(59, 130, 246, 0.35);

    --success: #10b981;
    --success-muted: rgba(16, 185, 129, 0.12);
    --success-border: rgba(16, 185, 129, 0.28);

    --telegram: #0088cc;

    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-border: rgba(239, 68, 68, 0.45);

    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-border: rgba(245, 158, 11, 0.35);

    --radius-card: 14px;
    --radius-control: 10px;
    --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 40px rgba(0, 0, 0, 0.45);
}

.auth-page {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--zinc-950);
    color: var(--zinc-200);
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

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

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--zinc-900);
    border: 1px solid var(--zinc-800);
    border-radius: var(--radius-card);
    padding: 32px 28px;
    box-shadow: var(--shadow-card);
}

.auth-card--wide {
    max-width: 480px;
}

.auth-card--form-wide {
    max-width: 420px;
}

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

.auth-wordmark {
    display: inline-block;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--zinc-100);
    text-decoration: none;
    margin-bottom: 6px;
}

.auth-wordmark:hover {
    color: #fff;
}

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

.auth-eyebrow {
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--zinc-400);
    margin: 0 0 24px;
}

.auth-card--center .auth-eyebrow {
    margin-left: auto;
    margin-right: auto;
    max-width: 20rem;
}

.auth-field {
    margin-bottom: 18px;
    text-align: left;
}

.auth-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--zinc-400);
    margin-bottom: 8px;
}

.auth-label-hint {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    color: var(--zinc-500);
}

.auth-input {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--zinc-100);
    background: var(--zinc-950);
    border: 1px solid var(--zinc-800);
    border-radius: var(--radius-control);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder {
    color: var(--zinc-500);
}

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

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

.auth-hint {
    font-size: 0.6875rem;
    line-height: 1.45;
    color: var(--zinc-500);
    margin-top: 6px;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-control);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

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

.auth-btn--primary {
    background: var(--primary);
    color: #fff;
    margin-top: 4px;
}

.auth-btn--primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.auth-btn--telegram {
    background: var(--telegram);
    color: #fff;
}

.auth-btn--telegram:hover:not(:disabled) {
    opacity: 0.92;
}

.auth-btn--muted {
    background: var(--zinc-800);
    color: var(--zinc-200);
}

.auth-btn--muted:hover:not(:disabled) {
    background: var(--zinc-700);
}

.auth-btn--outline {
    background: transparent;
    border: 1px solid var(--zinc-800);
    color: var(--zinc-200);
}

.auth-btn--outline:hover:not(:disabled) {
    border-color: var(--zinc-600);
    background: rgba(255, 255, 255, 0.03);
}

.auth-btn + .auth-btn {
    margin-top: 10px;
}

.auth-alert {
    font-size: 0.8125rem;
    line-height: 1.45;
    padding: 12px 14px;
    border-radius: var(--radius-control);
    margin-bottom: 20px;
    text-align: left;
}

.auth-alert--error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: #fca5a5;
}

.auth-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 0.875rem;
    color: var(--zinc-400);
    line-height: 1.5;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-back {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 0.8125rem;
}

.auth-back a {
    color: var(--zinc-500);
    text-decoration: none;
}

.auth-back a:hover {
    color: var(--zinc-400);
}

/* Connect + wide layouts */
.auth-top-bar {
    width: 100%;
    max-width: 480px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-top-bar a {
    color: var(--zinc-400);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-top-bar a:hover {
    color: var(--zinc-200);
}

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

.auth-page--stack {
    justify-content: flex-start;
    padding-top: 28px;
}

.auth-stack {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.auth-stack .auth-card {
    max-width: none;
    margin-bottom: 16px;
}

.auth-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--zinc-100);
    margin: 0 0 8px;
}

.auth-callout {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--zinc-400);
    margin-bottom: 20px;
    padding: 14px 16px;
    background: var(--success-muted);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-control);
}

.auth-callout strong {
    color: var(--zinc-200);
}

.auth-links-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 18px;
    font-size: 0.875rem;
}

.auth-links-row a {
    color: var(--telegram);
    text-decoration: none;
    font-weight: 500;
}

.auth-links-row a:hover {
    text-decoration: underline;
}

.auth-links-row .auth-dot {
    color: var(--zinc-800);
    user-select: none;
}

.auth-checklist {
    font-size: 0.875rem;
    color: var(--zinc-400);
    margin-bottom: 18px;
    padding: 14px 16px;
    background: var(--zinc-950);
    border: 1px solid var(--zinc-800);
    border-radius: var(--radius-control);
}

.auth-checklist h2,
.auth-checklist h4 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--zinc-200);
    margin: 0 0 10px;
    font-weight: 600;
}

.auth-checklist ol {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.55;
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 16px;
    border-radius: var(--radius-control);
    background: var(--zinc-950);
    border: 1px solid var(--zinc-800);
}

.auth-status--ok {
    border-color: rgba(16, 185, 129, 0.45);
}

.auth-status--warn {
    border-color: rgba(245, 158, 11, 0.45);
}

.auth-status-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.auth-status-text {
    font-weight: 600;
    font-size: 0.9375rem;
}

.auth-status--ok .auth-status-text {
    color: var(--success);
}

.auth-status--warn .auth-status-text {
    color: var(--warning);
}

.auth-token-panel {
    display: none;
    padding: 16px;
    background: var(--zinc-950);
    border: 1px solid var(--zinc-800);
    border-radius: var(--radius-control);
    margin-top: 14px;
}

.auth-token-panel.is-visible {
    display: block;
}

.auth-token-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--zinc-500);
    margin-bottom: 8px;
}

.auth-token-value {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.8125rem;
    word-break: break-all;
    padding: 11px 12px;
    background: var(--zinc-950);
    border: 1px solid var(--zinc-800);
    border-radius: 8px;
    color: var(--primary);
    margin-bottom: 12px;
}

.auth-countdown {
    font-size: 0.8125rem;
    color: var(--warning);
    margin-bottom: 12px;
}

.auth-countdown.is-expired {
    color: var(--danger);
}

.auth-help {
    font-size: 0.8125rem;
    color: var(--zinc-400);
    line-height: 1.6;
}

.auth-help h4 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--zinc-200);
    margin: 16px 0 8px;
    font-weight: 600;
}

.auth-help h4:first-child {
    margin-top: 0;
}

.auth-help ul {
    margin: 0;
    padding-left: 1.1rem;
}

.auth-help p {
    margin: 0 0 8px;
}

.auth-muted-block {
    font-size: 0.875rem;
    color: var(--zinc-400);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Success screen */
.auth-success-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.22);
}

.auth-success-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--zinc-100);
    margin: 0 0 10px;
}

.auth-success-highlight {
    color: var(--primary);
    font-weight: 700;
}

.auth-success-body {
    font-size: 0.9375rem;
    color: var(--zinc-400);
    margin: 0 0 24px;
    line-height: 1.55;
}

.auth-next-steps {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: var(--radius-control);
    padding: 16px;
    margin-top: 8px;
    text-align: left;
}

.auth-next-steps h3 {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    margin: 0 0 12px;
}

.auth-next-steps ol {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.8125rem;
    color: var(--zinc-400);
    line-height: 1.65;
}

.auth-expiry-note {
    font-size: 0.75rem;
    color: var(--warning);
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-control);
    text-align: left;
    line-height: 1.45;
}

.auth-code {
    display: inline-block;
    background: var(--zinc-950);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.6875rem;
    color: var(--primary);
    border: 1px solid var(--zinc-800);
}

.auth-fallback {
    margin-top: 16px;
    font-size: 0.75rem;
    color: var(--zinc-500);
    line-height: 1.5;
}

@media (min-width: 480px) {
    .auth-card {
        padding: 36px 32px;
    }
}
