/* ============================================================
   LogicPulse Auth Pages - shared styles (login / signup / reset)
   Same tokens as lp-theme.css, self-contained for the /auth pages.
   ============================================================ */

:root {
    --lp-bg: #0a0a0b;
    --lp-surface: #111113;
    --lp-surface-2: #1c1c1f;
    --lp-border: #27272a;
    --lp-border-strong: #3f3f46;
    --lp-text: #f4f4f5;
    --lp-text-2: #d4d4d8;
    --lp-text-3: #a1a1aa;
    --lp-accent: #10b981;
    --lp-accent-strong: #34d399;
    --lp-accent-soft: rgba(52, 211, 153, 0.14);
    --lp-danger: #fb7185;
    --lp-radius: 14px;
    --lp-radius-sm: 10px;
    --lp-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
    color-scheme: dark;
}

body {
    font-family: var(--lp-font);
    background: var(--lp-bg);
    color: var(--lp-text);
    line-height: 1.6;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    -webkit-font-smoothing: antialiased;
}

/* Single quiet pulse backdrop: concentric brand rings, one subtle glow.
   Static under prefers-reduced-motion (see bottom). */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 50% 42%, transparent 0 286px, rgba(16, 185, 129, 0.05) 287px, transparent 288px),
        radial-gradient(circle at 50% 42%, transparent 0 416px, rgba(16, 185, 129, 0.035) 417px, transparent 418px),
        radial-gradient(circle at 50% 42%, transparent 0 546px, rgba(16, 185, 129, 0.02) 547px, transparent 548px),
        radial-gradient(ellipse 70% 55% at 50% 42%, rgba(16, 185, 129, 0.07), transparent 70%);
}

::selection {
    background: var(--lp-accent-soft);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--lp-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Card ---------- */
.login-container,
.signup-container {
    width: 100%;
    max-width: 420px;
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: var(--lp-radius);
    padding: 40px 36px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* ---------- Logo ---------- */
.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--lp-text);
}

.logo img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: block;
}

.logo-subtitle {
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lp-text-3);
}

/* ---------- Alerts ---------- */
.error-alert,
.success-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    border-radius: var(--lp-radius-sm);
    font-size: 13.5px;
    line-height: 1.5;
}

.error-alert:empty,
.success-alert:empty {
    display: none;
}

.error-alert {
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.35);
    color: #fda4af;
}

.success-alert {
    background: var(--lp-accent-soft);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: var(--lp-accent-strong);
}

/* ---------- Form ---------- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--lp-text-2);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 11px 14px;
    background: var(--lp-surface-2);
    border: 1px solid var(--lp-border-strong);
    border-radius: var(--lp-radius-sm);
    color: var(--lp-text);
    font-family: var(--lp-font);
    font-size: 14.5px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-group input::placeholder {
    color: var(--lp-text-3);
    opacity: 1;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--lp-accent);
    box-shadow: 0 0 0 3px var(--lp-accent-soft);
}

/* ---------- Password toggle ---------- */
.password-container {
    position: relative;
}

.password-container input {
    padding-right: 44px;
}

.eye-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--lp-text-3);
    cursor: pointer;
    font-size: 15px;
    transition: color 0.15s ease;
}

.eye-icon:hover {
    color: var(--lp-accent-strong);
}

/* ---------- Submit ---------- */
.submit-btn {
    width: 100%;
    margin-top: 6px;
    padding: 12px 20px;
    background: var(--lp-accent);
    border: none;
    border-radius: var(--lp-radius-sm);
    color: #05201a;
    font-family: var(--lp-font);
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.06s ease;
}

.submit-btn:hover {
    background: var(--lp-accent-strong);
}

.submit-btn:active {
    transform: scale(0.98);
}

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

/* ---------- Footer links ---------- */
.auth-alt {
    text-align: center;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--lp-border);
}

.auth-alt p {
    color: var(--lp-text-3);
    font-size: 13.5px;
    margin-bottom: 12px;
}

.auth-alt .link-accent {
    color: var(--lp-accent-strong);
    text-decoration: none;
    font-weight: 600;
}

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

.footer {
    margin-top: 22px;
    text-align: center;
    font-size: 12.5px;
    color: var(--lp-text-3);
}

.footer a {
    color: var(--lp-text-2);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    color: var(--lp-accent-strong);
}

.documentation-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--lp-accent-strong);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
}

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

.documentation-link i {
    font-size: 0.75rem;
}

.forgot-link {
    align-self: flex-end;
    color: var(--lp-accent-strong);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
}

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

/* ---------- Signup grid (wider card) ---------- */
.login-container.wide,
.signup-container {
    max-width: 600px;
    padding: 36px 32px 24px;
}

.signup-form,
.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-row .full {
    grid-column: 1 / -1;
}

@media (max-width: 620px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.required {
    color: var(--lp-danger);
}

.input-group textarea {
    width: 100%;
    min-height: 72px;
    padding: 11px 14px;
    background: var(--lp-surface-2);
    border: 1px solid var(--lp-border-strong);
    border-radius: var(--lp-radius-sm);
    color: var(--lp-text);
    font-family: var(--lp-font);
    font-size: 14.5px;
    resize: vertical;
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--lp-accent);
    box-shadow: 0 0 0 3px var(--lp-accent-soft);
}

.field-hint {
    font-size: 12px;
    color: var(--lp-text-3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.field-hint i {
    color: var(--lp-accent-strong);
}

/* Submit spinner (AJAX loading state) */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(5, 32, 26, 0.35);
    border-top-color: #05201a;
    border-radius: 50%;
    animation: lp-spin 0.7s linear infinite;
    vertical-align: -3px;
    margin-right: 8px;
}

@keyframes lp-spin {
    to {
        transform: rotate(360deg);
    }
}

.field-hint-inline {
    font-size: 12px;
    color: var(--lp-text-3);
}

@media (max-width: 620px) {
    .login-container,
    .signup-container {
        padding: 28px 20px 20px;
    }
}

/* ---------- Reduced motion: everything still, everything works ---------- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   Extra auth pages (forgot / reset / verify) - shared vocabulary
   ============================================================ */

.container {
    width: 100%;
    max-width: 440px;
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: var(--lp-radius);
    padding: 40px 36px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.container .logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lp-accent);
    border-radius: 12px;
    font-size: 20px;
    color: #05201a;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--lp-text);
}

.subtitle {
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lp-text-3);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--lp-text-2);
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    background: var(--lp-surface-2);
    border: 1px solid var(--lp-border-strong);
    border-radius: var(--lp-radius-sm);
    color: var(--lp-text);
    font-family: var(--lp-font);
    font-size: 14.5px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input::placeholder {
    color: var(--lp-text-3);
    opacity: 1;
}

.form-group input:focus {
    outline: none;
    border-color: var(--lp-accent);
    box-shadow: 0 0 0 3px var(--lp-accent-soft);
}

.btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--lp-accent);
    border: none;
    border-radius: var(--lp-radius-sm);
    color: #05201a;
    font-family: var(--lp-font);
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.06s ease;
}

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

.btn:active {
    transform: scale(0.98);
}

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

.info-text {
    margin-top: 12px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--lp-text-3);
    text-align: center;
}

.footer-links {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--lp-border);
    text-align: center;
}

.footer-links a {
    color: var(--lp-accent-strong);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
}

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

/* 6-digit verification code input */
.code-input-single {
    font-size: 26px !important;
    letter-spacing: 0.5em !important;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Success message panel on verify page */
.success-message {
    background: var(--lp-accent-soft);
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: var(--lp-radius-sm);
    padding: 14px 16px;
    margin-bottom: 16px;
    color: var(--lp-accent-strong);
    font-size: 13.5px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.success-message .countdown {
    font-weight: 700;
}
