/* Shared auth-page card (signin / register / reset / forgot).
   Dark overrides below read html[data-theme] from localStorage. */

html, body.auth-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f1f5f9;
    color: #0f172a;
}

body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
}

.card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    margin-bottom: 24px;
}

.brand img {
    width: 48px;
    height: 48px;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
}

.brand-name {
    font-family: Outfit, sans-serif;
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.brand-sub {
    font-family: Outfit, sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-top: 3px;
}

.card h1 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
}

.subtitle {
    margin: 0 0 24px;
    font-size: 0.95rem;
    color: #64748b;
}

.account-input-wrapper,
.account-input-wrapper2 {
    margin-bottom: 14px;
}

label.reg-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 6px;
}

.account-input-wrapper input,
.account-input-wrapper2 input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    box-sizing: border-box;
}

.account-input-wrapper input:focus,
.account-input-wrapper2 input:focus {
    outline: none;
    border-color: #c17a4e;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.account-input-wrapper.error input,
.account-input-wrapper2.error input {
    border-color: #dc2626;
}

.field-password {
    position: relative;
}

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

.secret-masked {
    -webkit-text-security: disc;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    bottom: 6px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: #6b6560;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    color: #45413c;
    background: #f4f1ea;
}

.password-toggle-eye-off {
    display: none;
}

.password-toggle-btn.is-showing .password-toggle-eye {
    display: none;
}

.password-toggle-btn.is-showing .password-toggle-eye-off {
    display: block;
}

.password-hint,
.account-small-text {
    font-size: 0.8rem;
    color: #64748b;
    margin: -8px 0 14px;
}

.account-small-text.error {
    color: #dc2626;
}

.btn-blue {
    width: 100%;
    height: 44px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #e8d29a;
    color: #45413c;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    position: relative;
}

.btn-blue:hover {
    background: #dcc67e;
}

.btn-blue:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-blue.loading {
    pointer-events: none;
    color: transparent !important;
}

.btn-blue.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid #45413c;
    border-top-color: transparent;
    border-radius: 50%;
    animation: auth-spinner 0.6s linear infinite;
}

@keyframes auth-spinner {
    to { transform: rotate(360deg); }
}

.error-message {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.error-message.show {
    display: block;
}

.success-message {
    display: none;
    background: #e6f4ea;
    border: 1px solid #c6e7d0;
    color: #1e8e3e;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.success-message.show {
    display: block;
}

.footer-link {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

.footer-link a {
    color: #c17a4e;
    text-decoration: none;
    font-weight: 600;
}

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

.countdown {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 14px;
}

.countdown.warning {
    color: #dc2626;
}

.info-text {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 14px;
    line-height: 1.45;
}

/* Dark theme for standalone auth pages */

html[data-theme="dark"] {
    color-scheme: dark;
    --dk-0: #141414;
    --dk-3: #262626;
    --dk-4: #2d2d2d;
    --dk-5: #353535;
    --dk-line-strong: #474747;
    --dk-text: #cfcfcf;
    --dk-text-bright: #f2f2f2;
    --dk-text-dim: #9a9a9a;
    --dk-btn: #0e639c;
    --dk-btn-hover: #1177bb;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    background: var(--dk-0) !important;
    color: var(--dk-text);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .box {
    background: var(--dk-4) !important;
    border: 1px solid var(--dk-line-strong);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: var(--dk-text);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] .title,
html[data-theme="dark"] .brand-name {
    color: var(--dk-text-bright);
}

html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .title2,
html[data-theme="dark"] .brand-sub,
html[data-theme="dark"] .footer-link,
html[data-theme="dark"] label.reg-label,
html[data-theme="dark"] .reg-checkbox-label,
html[data-theme="dark"] .email-display,
html[data-theme="dark"] .code-label,
html[data-theme="dark"] .password-hint,
html[data-theme="dark"] .account-small-text,
html[data-theme="dark"] .countdown,
html[data-theme="dark"] .info-text {
    color: var(--dk-text-dim);
}

html[data-theme="dark"] .account-input-wrapper input,
html[data-theme="dark"] .account-input-wrapper2 input,
html[data-theme="dark"] .code-input {
    background: var(--dk-3);
    border-color: var(--dk-line-strong);
    color: var(--dk-text);
}

html[data-theme="dark"] .account-input-wrapper input:hover,
html[data-theme="dark"] .account-input-wrapper2 input:hover,
html[data-theme="dark"] .code-input:hover {
    border-color: #5a5a5a;
}

html[data-theme="dark"] .account-input-wrapper input:focus,
html[data-theme="dark"] .account-input-wrapper2 input:focus,
html[data-theme="dark"] .account-input-wrapper.active input,
html[data-theme="dark"] .code-input:focus {
    border-color: #3794ff;
    box-shadow: 0 0 0 3px rgba(55, 148, 255, 0.2);
    color: var(--dk-text-bright);
}

html[data-theme="dark"] .btn-blue,
html[data-theme="dark"] .btn {
    background: var(--dk-btn);
    background-color: var(--dk-btn);
    color: #fff;
    border-color: var(--dk-btn);
}

html[data-theme="dark"] .btn-blue:hover,
html[data-theme="dark"] .btn:hover:not(:disabled) {
    background: var(--dk-btn-hover);
    background-color: var(--dk-btn-hover);
}

html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] .btn-blue:disabled {
    background: var(--dk-5);
    background-color: var(--dk-5);
    color: var(--dk-text-dim);
}

html[data-theme="dark"] .btn-blue.loading::after {
    border-color: #fff;
    border-top-color: transparent;
}

html[data-theme="dark"] .google-btn {
    background: var(--dk-3);
    border-color: var(--dk-line-strong);
    color: var(--dk-text);
}

html[data-theme="dark"] .google-btn:hover {
    background: var(--dk-5);
}

html[data-theme="dark"] .divider {
    color: var(--dk-text-dim);
}

html[data-theme="dark"] .divider::before,
html[data-theme="dark"] .divider::after {
    background: var(--dk-line-strong);
}

html[data-theme="dark"] .footer-link a,
html[data-theme="dark"] .signin-forgot-password,
html[data-theme="dark"] .reg-blue-text,
html[data-theme="dark"] .resend-link,
html[data-theme="dark"] .change-email-link {
    color: #7cb7f0;
}

html[data-theme="dark"] .resend-link.disabled {
    color: #6e6e6e;
}

html[data-theme="dark"] .password-toggle-btn {
    color: var(--dk-text-dim);
}

html[data-theme="dark"] .password-toggle-btn:hover {
    color: var(--dk-text-bright);
    background: var(--dk-5);
}

html[data-theme="dark"] .error-message {
    background: #3a2020;
    border-color: #6b3030;
    color: #f0a0a0;
}

html[data-theme="dark"] .success-message {
    background: #1e3324;
    border-color: #2d5a3a;
    color: #8fd4a2;
}

html[data-theme="dark"] .reg-checkbox-input {
    accent-color: #3794ff;
}
