:root {
  --ink: #0b0f1f;
  --muted: #4b5563;
  --surface: #ffffff;
  --surface-soft: #efe5d8;
  --accent: #b45309;
  --accent-2: #0d6e78;
  --primary: #b45309;
  --stroke: rgba(12, 15, 25, 0.12);
  --shadow: 0 24px 60px rgba(13, 27, 55, 0.12);
  --focus-ring: 0 0 0 3px rgba(180, 83, 9, 0.4);
  --iti-path-flags-1x: url("vendor/intl-tel-input/img/flags.png");
  --iti-path-flags-2x: url("vendor/intl-tel-input/img/flags@2x.png");
  --iti-path-globe-1x: url("vendor/intl-tel-input/img/globe.png");
  --iti-path-globe-2x: url("vendor/intl-tel-input/img/globe@2x.png");
}

/* Dark mode - explicit selection */
html[data-theme="dark"] {
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --surface: #1e293b;
  --surface-soft: #334155;
  --accent: #f59e0b;
  --accent-2: #22d3ee;
  --primary: #d97706;
  --stroke: rgba(241, 245, 249, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

/* System preference - applies when no explicit theme set */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) {
    --ink: #f1f5f9;
    --muted: #94a3b8;
    --surface: #1e293b;
    --surface-soft: #334155;
    --accent: #f59e0b;
    --accent-2: #22d3ee;
    --primary: #d97706;
    --stroke: rgba(241, 245, 249, 0.12);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  }
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--ink);
  color: #fff;
  padding: 8px 16px;
  z-index: 1000;
  text-decoration: none;
  font-family: "Sora", sans-serif;
  font-size: 14px;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  top: 0;
}

* {
  box-sizing: border-box;
}

a:focus,
button:focus {
  outline: none;
}

a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

html {
  scroll-behavior: smooth;
  /* Account for header when scrolling to anchors */
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  font-family: "Newsreader", serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fdf6ea, transparent 50%),
    radial-gradient(circle at 80% 20%, #eaf4ff, transparent 55%),
    linear-gradient(140deg, #fdf8f1, #f4f7ff);
  min-height: 100vh;
}

/* Dark mode body background */
html[data-theme="dark"] body {
  background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.08), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.05), transparent 55%),
    linear-gradient(140deg, #0f172a, #1e293b);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) body {
    background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.08), transparent 50%),
      radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.05), transparent 55%),
      linear-gradient(140deg, #0f172a, #1e293b);
  }
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px clamp(20px, 3vw, 40px) 64px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Sora", sans-serif;
  font-weight: 600;
}

.mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(217, 119, 6, 0.3);
}

.mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wordmark {
  font-size: 18px;
  letter-spacing: 0.5px;
}

.site-actions {
  display: flex;
  gap: 12px;
}

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: "Sora", sans-serif;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

.button.primary:hover {
  transform: translateY(-1px);
}

.button.primary:focus-visible {
  outline: none;
  box-shadow: var(--shadow), var(--focus-ring);
}

.button.ghost {
  border-color: var(--stroke);
  color: var(--ink);
  background: #fff;
  transition: opacity 0.2s ease;
}

.button.ghost:hover {
  opacity: 0.7;
}

.button.ghost:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.button.text {
  color: var(--accent);
  background: none;
  padding: 10px 4px;
  transition: opacity 0.2s ease;
}

.button.text:hover {
  opacity: 0.7;
}

.button.text:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  margin-bottom: 64px;
}

.hero-copy h1 {
  font-family: "Sora", sans-serif;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.1;
  margin: 16px 0;
}

.eyebrow {
  font-family: "Sora", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--accent);
  margin-bottom: 12px;
}

.tagline {
  font-family: "Sora", sans-serif;
  font-size: 15px;
  color: var(--accent-2);
  margin: 0 0 8px;
  font-weight: 500;
}

.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 24px 0;
}

.signal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.signal-label {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.hero-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(12, 15, 25, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-family: "Sora", sans-serif;
  margin: 0;
}

.pill {
  font-family: "Sora", sans-serif;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(14, 124, 134, 0.12);
  color: var(--accent);
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checklist li::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--stroke);
}

.metric-label {
  font-family: "Sora", sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.metric-value {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  margin: 4px 0 0;
}

/* Stats Section */
.stats-section {
  margin: 72px 0;
  text-align: center;
}

.stats-header {
  max-width: 640px;
  margin: 0 auto 40px;
}

.stats-header h2 {
  font-family: "Sora", sans-serif;
  font-size: clamp(24px, 3vw, 36px);
  margin-top: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.stat-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 32px 24px;
  border: 1px solid rgba(12, 15, 25, 0.08);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.stat-card.stat-primary {
  background: linear-gradient(135deg, #d97706 0%, #c2410c 100%);
  color: #fff;
  border: none;
}

.stat-card.stat-primary .stat-source {
  color: rgba(255, 255, 255, 0.85);
}

.stat-value {
  font-family: "Sora", sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

.stat-card.stat-primary .stat-label {
  color: rgba(255, 255, 255, 0.9);
}

.stat-source {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  color: var(--muted);
  margin-top: auto;
  padding-top: 12px;
  opacity: 0.7;
}

.stats-cta {
  font-family: "Sora", sans-serif;
  font-size: 16px;
  color: var(--accent-2);
  font-weight: 500;
  margin-top: 32px;
}

.stat-source a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  transition: opacity 0.2s ease;
}

.stat-source a:hover {
  opacity: 0.8;
}

.stat-source a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 2px;
}

.stat-card.stat-primary .stat-source a {
  color: rgba(255, 255, 255, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat-card {
    padding: 24px 20px;
  }
}

.section {
  margin: 72px 0;
}

.section-header {
  max-width: 640px;
  margin-bottom: 32px;
}

.section h2 {
  font-family: "Sora", sans-serif;
  font-size: clamp(24px, 3vw, 36px);
  margin-bottom: 12px;
}

.section p {
  color: var(--muted);
  line-height: 1.6;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.feature {
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgba(12, 15, 25, 0.08);
  box-shadow: 0 10px 30px rgba(12, 15, 25, 0.08);
}

.feature-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin-bottom: 12px;
}

.feature h3 {
  font-family: "Sora", sans-serif;
  margin-top: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.steps {
  display: grid;
  gap: 18px;
}

.step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.step-number {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--accent);
}

.callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: center;
}

.callout-list {
  display: grid;
  gap: 12px;
  font-family: "Sora", sans-serif;
  color: var(--muted);
}

.callout-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid rgba(12, 15, 25, 0.08);
  box-shadow: var(--shadow);
}

.callout-card h3 {
  font-family: "Sora", sans-serif;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.form-field {
  display: grid;
  gap: 6px;
}

label {
  font-family: "Sora", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

input[type="email"],
input[type="text"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  font-family: "Sora", sans-serif;
  background: #fff;
}

input[type="email"]:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.iti {
  width: 100%;
}

.iti--separate-dial-code .iti__selected-flag {
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--stroke);
  border-right: 0;
  border-radius: 12px 0 0 12px;
}

.iti--separate-dial-code input[type="tel"] {
  border-left: 0;
  border-radius: 0 12px 12px 0;
}

.iti__selected-flag {
  gap: 8px;
}

.iti__selected-flag:hover,
.iti__selected-flag:focus-within {
  background: #f8fafc;
}

.iti__selected-dial-code {
  font-family: "Sora", sans-serif;
  color: var(--ink);
}

.iti__arrow {
  border-top-color: var(--muted);
}

.iti__country-list {
  font-family: "Sora", sans-serif;
  font-size: 13px;
  border-radius: 12px;
  border: 1px solid rgba(12, 15, 25, 0.1);
  box-shadow: 0 18px 40px rgba(12, 15, 25, 0.18);
}

.iti__country-name,
.iti__dial-code {
  font-family: "Sora", sans-serif;
}

.iti__flag {
  background-image: var(--iti-path-flags-1x) !important;
}

.iti__globe {
  background-image: var(--iti-path-globe-1x) !important;
}

@media (min-resolution: 2dppx) {
  .iti__flag {
    background-image: var(--iti-path-flags-2x) !important;
  }

  .iti__globe {
    background-image: var(--iti-path-globe-2x) !important;
  }
}

textarea {
  margin-bottom: 12px;
  resize: vertical;
  min-height: 90px;
}

.form-note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
  min-height: 1.4em;
}

.form-note.error {
  color: var(--accent);
  font-weight: 600;
  margin-top: 20px;
}

.input-group.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.input-group.error input,
.input-group.error input:focus {
  border-color: #dc2626;
  border-right: 1px solid #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

.field-warning {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 12px;
  color: #d32f2f;
  margin-top: 4px;
}

input.invalid,
textarea.invalid {
  border-color: #d32f2f;
}

input.invalid:focus,
textarea.invalid:focus {
  outline-color: #d32f2f;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15);
}

.login-main {
  margin: 48px 0;
}

.login-simple {
  max-width: 400px;
  margin: 0 auto;
}

.login-simple .login-card {
  text-align: center;
}

.login-simple .login-title {
  margin-bottom: 24px;
}

.login-simple .form-field {
  text-align: left;
}

.login-simple .button.primary {
  width: 100%;
  margin-top: 8px;
}

.form-hint {
  font-family: "Sora", sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.form-hint strong {
  color: var(--ink);
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group input {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
  min-width: 0;
}

.input-group input:focus {
  z-index: 1;
  border-right: 1px solid var(--accent);
}

.input-suffix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-family: "Sora", sans-serif;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--stroke);
  border-left: none;
  border-radius: 0 8px 8px 0;
  white-space: nowrap;
  user-select: none;
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

.login-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 32px;
  border: 1px solid rgba(12, 15, 25, 0.08);
  box-shadow: var(--shadow);
}

.login-title {
  font-family: "Sora", sans-serif;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.15;
  margin: 12px 0 16px;
}

.login-hint {
  font-family: "Sora", sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}

.login-support {
  margin-top: 48px;
  background: rgba(14, 124, 134, 0.08);
  border-radius: 24px;
  padding: 28px;
}

.login-support h2 {
  font-family: "Sora", sans-serif;
  margin-top: 0;
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.legal-main {
  margin: 24px 0 48px;
}

.legal-content {
  max-width: 720px;
}

.legal-content h1 {
  font-family: "Sora", sans-serif;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.15;
  margin: 12px 0 16px;
}

.legal-updated {
  font-family: "Sora", sans-serif;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 32px;
}

.legal-section {
  margin-bottom: 32px;
}

.legal-section h2 {
  font-family: "Sora", sans-serif;
  font-size: 18px;
  margin-bottom: 12px;
}

.legal-section p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-section ul {
  color: var(--muted);
  line-height: 1.7;
  padding-left: 24px;
  margin: 12px 0;
}

.legal-section li {
  margin-bottom: 8px;
}

.legal-section a {
  color: var(--accent);
  text-decoration: none;
}

.legal-section a:hover {
  text-decoration: underline;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.site-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--stroke);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: "Sora", sans-serif;
  font-size: 14px;
}

.footer-left {
  max-width: 360px;
}

.footer-security {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.footer-legal {
  font-size: 12px;
  margin-top: 8px;
}

.footer-legal a {
  color: var(--muted);
  text-decoration: none;
}

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

.footer-copy {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  text-align: right;
}

.footer-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
}

.footer-contact p {
  margin: 0;
}

.footer-contact a {
  color: inherit;
  text-decoration: none;
}

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

.footer-contact a.footer-login {
  color: var(--accent);
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.footer-contact a.footer-login:hover {
  text-decoration: none;
  opacity: 0.7;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .site-actions .button.ghost {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .split,
  .callout,
  .login-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .reveal {
    transition: none;
  }
}

/* Dark mode form inputs */
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--surface-soft);
  color: var(--ink);
  border-color: var(--stroke);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--muted);
}

html[data-theme="dark"] .iti--separate-dial-code .iti__selected-flag {
  background: #1e293b;
  border-color: rgba(241, 245, 249, 0.15);
}

html[data-theme="dark"] .iti__selected-flag:hover,
html[data-theme="dark"] .iti__selected-flag:focus-within {
  background: var(--surface);
}

html[data-theme="dark"] .iti__selected-dial-code {
  color: var(--ink);
}

html[data-theme="dark"] .iti__country-list {
  background: var(--surface);
  border-color: var(--stroke);
}

html[data-theme="dark"] .iti__country {
  background: transparent;
}

html[data-theme="dark"] .iti__country:hover,
html[data-theme="dark"] .iti__country.iti__highlight {
  background: rgba(241, 245, 249, 0.08);
}

html[data-theme="dark"] .iti__country-name {
  color: var(--ink);
}

html[data-theme="dark"] .iti__dial-code {
  color: var(--muted);
}

html[data-theme="dark"] .iti__divider {
  border-bottom-color: var(--stroke);
}

html[data-theme="dark"] .iti__search-input {
  background: var(--surface-soft);
  color: var(--ink);
  border-color: var(--stroke);
}

html[data-theme="dark"] .iti__search-input::placeholder {
  color: var(--muted);
}

/* Dark mode stat card adjustments */
html[data-theme="dark"] .stat-card:not(.stat-primary) {
  border-color: var(--stroke);
  border: 1px solid var(--stroke);
}

html[data-theme="dark"] .stat-card {
  border: 1px solid var(--stroke);
}

html[data-theme="dark"] .stat-card.stat-primary {
  border: none;
}

html[data-theme="dark"] .hero-card,
html[data-theme="dark"] .feature,
html[data-theme="dark"] .callout-card,
html[data-theme="dark"] .login-card {
  border-color: var(--stroke);
}

/* System preference dark mode - card adjustments */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) .stat-card:not(.stat-primary) {
    border: 1px solid var(--stroke);
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .stat-card.stat-primary {
    border: none;
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .hero-card,
  html:not([data-theme="light"]):not([data-theme="dark"]) .feature,
  html:not([data-theme="light"]):not([data-theme="dark"]) .callout-card,
  html:not([data-theme="light"]):not([data-theme="dark"]) .login-card {
    border-color: var(--stroke);
  }
}

/* Theme selector */
.theme-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid var(--stroke);
  margin-left: auto;
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s ease;
}

.theme-btn:hover {
  color: var(--ink);
  background: rgba(180, 83, 9, 0.1);
}

.theme-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.theme-btn svg {
  width: 18px;
  height: 18px;
}

html[data-theme="dark"] .theme-btn.active {
  background: var(--surface);
}

/* Dark mode button adjustments - match stat-primary gradient */
html[data-theme="dark"] .button.primary {
  background: linear-gradient(135deg, #d97706 0%, #c2410c 100%);
  color: #fff;
}

html[data-theme="dark"] .button.primary:hover {
  background: linear-gradient(135deg, #b45309 0%, #9a3412 100%);
}

html[data-theme="dark"] .button.ghost {
  background: #334155;
  border-color: rgba(241, 245, 249, 0.2);
  color: #fff;
}

html[data-theme="dark"] .button.ghost:hover {
  background: #475569;
  opacity: 1;
}

/* Dark mode form input enhancements */
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #1e293b;
  color: #ffffff;
  border-color: rgba(241, 245, 249, 0.15);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #9ca3af;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* System preference dark mode - button adjustments */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) .button.primary {
    background: linear-gradient(135deg, #d97706 0%, #c2410c 100%);
    color: #fff;
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .button.primary:hover {
    background: linear-gradient(135deg, #b45309 0%, #9a3412 100%);
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) input[type="email"],
  html:not([data-theme="light"]):not([data-theme="dark"]) input[type="text"],
  html:not([data-theme="light"]):not([data-theme="dark"]) input[type="tel"],
  html:not([data-theme="light"]):not([data-theme="dark"]) select,
  html:not([data-theme="light"]):not([data-theme="dark"]) textarea {
    background: #1e293b;
    color: #ffffff;
    border-color: rgba(241, 245, 249, 0.15);
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) input::placeholder,
  html:not([data-theme="light"]):not([data-theme="dark"]) textarea::placeholder {
    color: #9ca3af;
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .button.ghost {
    background: #334155;
    border-color: rgba(241, 245, 249, 0.2);
    color: #fff;
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .button.ghost:hover {
    background: #475569;
    opacity: 1;
  }

  /* intl-tel-input dropdown for system dark mode */
  html:not([data-theme="light"]):not([data-theme="dark"]) .iti--separate-dial-code .iti__selected-flag {
    background: #1e293b;
    border-color: rgba(241, 245, 249, 0.15);
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .iti__selected-flag:hover,
  html:not([data-theme="light"]):not([data-theme="dark"]) .iti__selected-flag:focus-within {
    background: #334155;
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .iti__selected-dial-code {
    color: #f1f5f9;
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .iti__country-list {
    background: #1e293b;
    border-color: rgba(241, 245, 249, 0.15);
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .iti__country {
    background: transparent;
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .iti__country:hover,
  html:not([data-theme="light"]):not([data-theme="dark"]) .iti__country.iti__highlight {
    background: rgba(241, 245, 249, 0.08);
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .iti__country-name {
    color: #f1f5f9;
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .iti__dial-code {
    color: #9ca3af;
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .iti__divider {
    border-bottom-color: rgba(241, 245, 249, 0.15);
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .iti__search-input {
    background: #1e293b;
    color: #f1f5f9;
    border-color: rgba(241, 245, 249, 0.15);
  }

  html:not([data-theme="light"]):not([data-theme="dark"]) .iti__search-input::placeholder {
    color: #9ca3af;
  }
}
