/* Shared auth pages (login / register / forgot password / loyalty auth).
   Colours and type come from /brand.css tokens; dark is the default theme
   (<html data-theme-default="dark">), switched by /theme.js. */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }
body { font-family: var(--font-sans); background: var(--color-bg); color: var(--color-text); min-height: 100dvh; display: flex; flex-direction: column; align-items: center; -webkit-font-smoothing: antialiased; }
a { color: inherit; }

.auth-corner { position: fixed; top: 16px; right: 20px; display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--color-text); font-weight: 700; font-size: 15px; z-index: 2; }
.auth-corner img { width: 32px; height: 32px; border-radius: 9px; }
.theme-toggle { position: fixed; top: 14px; left: 18px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--color-border-strong); background: transparent; color: var(--color-text); display: grid; place-items: center; cursor: pointer; z-index: 2; }
.theme-toggle:hover { background: var(--color-surface-2); }
.theme-toggle svg { width: 17px; height: 17px; }
.i-sun { display: none; } .i-moon { display: block; }
[data-theme="dark"] .i-sun { display: block; } [data-theme="dark"] .i-moon { display: none; }

.auth-container { width: 100%; max-width: 400px; padding: 76px 20px 40px; margin: auto 0; }
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo { display: none; }
.auth-kicker { font-size: 32px; font-weight: 400; color: var(--color-text-subtle); line-height: 1.4; }
.auth-header h1 { font-size: 32px; font-weight: 700; color: var(--color-text); line-height: 1.4; }
.auth-header p { color: var(--color-text-muted); font-size: 15px; margin-top: 8px; }

.auth-card { background: none; border: none; padding: 0; box-shadow: none; }
.form-group { margin-bottom: 12px; }
.form-group label, .form-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-input, .auth-card select { width: 100%; height: 52px; padding: 0 20px; background: transparent; border: 1px solid var(--color-border-strong); border-radius: var(--radius-pill); color: var(--color-text); font-family: inherit; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; }
.auth-card select { appearance: none; -webkit-appearance: none; color: var(--color-text-subtle); }
.auth-card select:valid { color: var(--color-text); }
.auth-card select option { background: var(--color-surface); color: var(--color-text); }
.form-input::placeholder { color: var(--color-text-subtle); }
.form-input:focus, .auth-card select:focus { border-color: var(--color-icon); box-shadow: 0 0 0 3px var(--color-focus); }
.form-input:-webkit-autofill { -webkit-text-fill-color: var(--color-text); -webkit-box-shadow: 0 0 0 40px var(--color-surface) inset; transition: background-color 9999s; }

.password-wrap { position: relative; }
.password-wrap .form-input { padding-left: 50px; }
.toggle-password { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--color-text-subtle); cursor: pointer; display: grid; place-items: center; }
.toggle-password svg { width: 18px; height: 18px; }
.password-hint, .field-hint { font-size: 13px; color: var(--color-text-subtle); margin: 6px 20px 0; }

.row-between { display: flex; align-items: center; justify-content: space-between; margin: 4px 6px 18px; font-size: 14px; color: var(--color-text-muted); }
.row-between a { color: var(--color-text-muted); text-decoration: underline; text-underline-offset: 3px; }
.row-between label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
input[type=checkbox] { accent-color: var(--color-cta); width: 15px; height: 15px; cursor: pointer; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; border-radius: var(--radius-pill); font-family: inherit; font-size: 17px; font-weight: 700; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .1s; margin-top: 8px; }
.btn:active { transform: scale(.99); }
.btn-primary { background: var(--color-cta); color: var(--color-on-cta); border: none; }
.btn-primary:hover { background: var(--color-cta-hover); }
.btn-outline { background: transparent; color: var(--color-text); border: 1px solid var(--color-border-strong); }
.btn-outline:hover { border-color: var(--color-icon); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.divider { display: flex; align-items: center; gap: 16px; color: var(--color-text-subtle); font-size: 14px; margin: 22px 16px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }
.auth-card > a { text-decoration: none; }
.auth-card > a.btn { display: flex; }

.alert { display: none; padding: 11px 16px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 14px; text-align: center; }
.alert-error { background: var(--color-danger-bg); color: var(--color-danger); }
.alert-success { background: var(--color-success-bg); color: var(--color-success); }

.verify-section { display: none; }
.code-input { text-align: center; letter-spacing: 12px; font-size: 22px; direction: ltr; font-family: var(--font-en); }
.resend-link, .auth-links { text-align: center; margin-top: 18px; font-size: 14px; color: var(--color-text-muted); }
.resend-link a, .auth-links a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.auth-legal { text-align: center; font-size: 13px; color: var(--color-text-subtle); line-height: 1.9; margin-top: 26px; }
.auth-legal a { color: var(--color-text-muted); text-decoration: underline; text-underline-offset: 2px; }
.check-line { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--color-text-muted); margin: 6px 6px 8px; line-height: 1.8; }
.check-line input { margin-top: 5px; flex-shrink: 0; }
.check-line a { color: var(--color-accent); }
.ltr { direction: ltr; text-align: left; }
.ltr::placeholder { text-align: right; direction: rtl; }

/* forgot-password: one stage visible at a time */
.step { display: none; }
.step.active { display: block; }
@media (max-width: 480px) { .auth-kicker, .auth-header h1 { font-size: 27px; } .auth-container { padding-top: 78px; } }

/* "Continue with Google / Apple": outline pills carrying the providers' own marks */
.social-auth { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.social-auth[hidden], .btn-social[hidden] { display: none !important; }
.social-auth .divider { margin-top: 18px; margin-bottom: 8px; }
.btn-social { background: transparent; color: var(--color-text); border: 1px solid var(--color-border-strong); font-size: 16px; font-weight: 500; text-decoration: none; }
.btn-social:hover { border-color: var(--color-icon); }
.btn-social svg { width: 20px; height: 20px; flex-shrink: 0; }
