/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Colors - Light Mode (iOS matched) */
:root, [data-theme="light"] {
  /* Primary - AccentColor */
  --primary: #252333;
  --accent-tint: #e9e3ff;
  --on-primary: #ffffff;
  --primary-hover: #3b3652;

  /* Text */
  --text: #111827;
  --text-secondary: #6b7280;

  /* Backgrounds */
  --background: #f2f2f7;
  --card-background: rgba(153, 153, 153, 0.1);
  --card-solid: #ffffff;

  /* Borders */
  --border: #d1d1d6;
  --border-subtle: #e5e5ea;

  /* Overlays */
  --overlay-background: rgba(0, 0, 0, 0.4);
  --processing-background: rgba(0, 0, 0, 0.8);
  --progress-background: rgba(153, 153, 153, 0.3);

  /* Status colors */
  --error-bg: #fee2e2;
  --error-text: #991b1b;
  --error-color: #dc2626;
  --success-bg: #d1fae5;
  --success-text: #065f46;
}

/* Colors - Dark Mode (iOS matched) */
[data-theme="dark"] {
  /* Primary - AccentColor Dark */
  --primary: #c8baff;
  --accent-tint: #302c4a;
  --on-primary: #252333;
  --primary-hover: #d9cfff;

  /* Text */
  --text: #f9fafb;
  --text-secondary: #9ca3af;

  /* Backgrounds */
  --background: #000000;
  --card-background: rgba(255, 255, 255, 0.15);
  --card-solid: #1c1c1e;

  /* Borders */
  --border: #3a3a3c;
  --border-subtle: #2c2c2e;

  /* Overlays */
  --overlay-background: rgba(0, 0, 0, 0.6);
  --processing-background: rgba(0, 0, 0, 0.9);
  --progress-background: rgba(255, 255, 255, 0.4);

  /* Status colors */
  --error-bg: #7f1d1d;
  --error-text: #fecaca;
  --error-color: #ef4444;
  --success-bg: #064e3b;
  --success-text: #a7f3d0;
}

/* Typography */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
}

a { color: var(--primary); }

/* Loading spinner */
.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.6s linear infinite;
}

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

/* Alpine.js cloak */
[x-cloak] {
  display: none !important;
}

/* Current brand lockups retain their proportions in both themes. */
.brand-dark { display: none; }
[data-theme="dark"] .brand-light { display: none; }
[data-theme="dark"] .brand-dark { display: inline-block; }

/* Keep keyboard focus visible across pointer and keyboard controls. */
:root :where(a, button, input, select, textarea, summary, [role="button"]):focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
