/* =========================================================
   PROMPT STUDIO — AUTH PAGES
   Shared styles for /signup, /login, /forgot-password,
   /reset-password, /auth-callback
   ========================================================= */

:root {
  --navy: #1A2F4F;
  --navy-soft: #243a5d;
  --navy-deep: #0f1e36;
  --gold: #C9A961;
  --gold-soft: #d4ba7c;
  --cream: #f5f3ee;
  --paper: #fafaf8;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-muted: #7a7a7a;
  --line: #e5e0d6;
  --line-soft: #efeae0;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --success: #15803d;
  --success-bg: #f0fdf4;

  --font-display: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-arabic: 'Noto Sans Arabic', system-ui, sans-serif;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Language toggle state */
.lang-en { display: inline; }
.lang-ar-content { display: none; }
.lang-es-content { display: none; }
body.lang-ar .lang-en { display: none; }
body.lang-ar .lang-ar-content {
  display: inline;
  font-family: var(--font-arabic);
}
body.lang-ar { direction: rtl; }
body.lang-es .lang-en { display: none; }
body.lang-es .lang-es-content { display: inline; }

a {
  color: var(--navy);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* =========================================================
   HEADER (minimal, reusable)
   ========================================================= */

.auth-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.auth-header-inner {
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

@media (min-width: 720px) {
  .auth-header-inner {
    padding-left: var(--space-5);
    padding-right: var(--space-5);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--navy);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

@media (max-width: 640px) {
  .brand-sub { display: none; }
}

.auth-header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.lang-btn {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
}

.lang-btn.active {
  background: var(--navy);
  color: var(--cream);
}

/* =========================================================
   MAIN AUTH LAYOUT
   ========================================================= */

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-3);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
}

@media (min-width: 480px) {
  .auth-card {
    padding: var(--space-5);
  }
}

.auth-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 0 0 var(--space-2) 0;
}

.auth-lede {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 var(--space-4) 0;
}

/* =========================================================
   FORM
   ========================================================= */

.field {
  margin-bottom: var(--space-3);
}

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 150ms, box-shadow 150ms;
  -webkit-appearance: none;
  appearance: none;
}

.field-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 47, 79, 0.1);
}

.field-input[type="password"] {
  letter-spacing: 0.05em;
}

.field-hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.field-row .field-label { margin-bottom: 0; }

.field-link {
  font-size: 12px;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: var(--space-3);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.checkbox-row input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--navy);
  cursor: pointer;
}

.checkbox-row a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms, border-color 150ms, opacity 150ms;
}

.btn-block { display: flex; width: 100%; }

.btn-accent {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
}
.btn-accent:hover { background: var(--navy-deep); border-color: var(--navy-deep); }

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--cream); border-color: var(--navy); }

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

.btn .spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.7; }

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

/* =========================================================
   MESSAGES
   ========================================================= */

.message {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: var(--space-3);
  display: none;
}

.message.is-visible { display: block; }

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

.message-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #86efac;
}

/* =========================================================
   FOOTER (small print under the card)
   ========================================================= */

.auth-foot {
  text-align: center;
  margin-top: var(--space-3);
  font-size: 14px;
  color: var(--ink-soft);
}

.auth-foot a {
  color: var(--navy);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-foot .divider {
  display: inline-block;
  margin: 0 8px;
  color: var(--ink-muted);
}

/* Page footer (legal links + copyright) */

.page-foot {
  padding: var(--space-3);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  padding-bottom: max(var(--space-3), env(safe-area-inset-bottom, 0));
}

.page-foot a {
  color: var(--ink-muted);
  text-decoration: underline;
  margin: 0 8px;
}
.page-foot a:hover { color: var(--navy); }
