/* Shares the main site's citrus palette (style.css) rather than a separate identity,
   so the auth flow reads as part of the same product. */
:root {
  --bg-base: #f6f8ee;
  --bg-card: #ffffff;
  --bg-input: #f6f8ee;
  --border: #dfe6c9;
  --accent: #6f9138;
  --accent-secondary: #e2792c;
  --accent-soft: rgba(111, 145, 56, 0.12);
  --accent-soft-border: rgba(111, 145, 56, 0.25);
  --text-primary: #20281a;
  --text-secondary: #5d6b4e;
  --text-muted: #93a082;
  --btn-text: #ffffff;
}

:root[data-theme='dark'] {
  --bg-base: #171d13;
  --bg-card: #202b19;
  --bg-input: #171d13;
  --border: #37432c;
  --accent: #94c05a;
  --accent-secondary: #e89a5c;
  --accent-soft: rgba(148, 192, 90, 0.14);
  --accent-soft-border: rgba(148, 192, 90, 0.3);
  --text-primary: #eef3e3;
  --text-secondary: #b7c2a8;
  --text-muted: #7c8a6c;
  --btn-text: #16210c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg-base: #171d13;
    --bg-card: #202b19;
    --bg-input: #171d13;
    --border: #37432c;
    --accent: #94c05a;
    --accent-secondary: #e89a5c;
    --accent-soft: rgba(148, 192, 90, 0.14);
    --accent-soft-border: rgba(148, 192, 90, 0.3);
    --text-primary: #eef3e3;
    --text-secondary: #b7c2a8;
    --text-muted: #7c8a6c;
    --btn-text: #16210c;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  width: 100%;
  max-width: 384px;
}

.auth-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.auth-tagline {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
  margin: 0 0 24px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

.auth-card h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 4px;
  text-align: center;
}

.auth-card .subtitle {
  font-size: 0.875rem;
  text-align: center;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 10px 0;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 16px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.divider .line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.card-head h1,
.card-head .subtitle {
  text-align: left;
  margin: 0;
}

.card-head .subtitle {
  margin-top: 2px;
}

.step-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-soft-border);
  white-space: nowrap;
}

.mail-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
  color: var(--accent);
  flex-shrink: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.field-top-row a {
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
}

.field-row {
  position: relative;
}

.field input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.875rem;
  outline: none;
  font-family: inherit;
}

.field input:focus {
  border-color: var(--accent);
}

.eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  display: flex;
}

/* Edge/IE inject their own reveal-password eye icon at the same corner as
   our custom .eye-btn, showing two eyes side by side — turn theirs off. */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

.error-box {
  font-size: 0.75rem;
  padding: 8px 12px;
  border-radius: 8px;
  color: #c0392b;
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.2);
  margin-bottom: 16px;
}

.error-box a {
  color: var(--accent);
}

.info-box {
  font-size: 0.75rem;
  padding: 8px 12px;
  border-radius: 8px;
  color: #3f8b52;
  background: rgba(63, 139, 82, 0.08);
  border: 1px solid rgba(63, 139, 82, 0.2);
  margin-bottom: 16px;
}

.submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 0;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.875rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: var(--btn-text);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.1s;
}

.submit-btn:hover {
  opacity: 0.88;
}

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

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

.auth-switch {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 20px;
}

.auth-switch a,
.auth-switch button {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.terms-text {
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-muted);
  margin-top: 16px;
}

.otp-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.otp-box {
  width: 46px;
  height: 54px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.otp-box:focus,
.otp-box.filled {
  border-color: var(--accent);
}

.otp-timer {
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.otp-timer.expired {
  color: #c0392b;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--btn-text);
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

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