/* ============================================================
   SHARED THEME — Light, Minimal, Mobile-First
   ============================================================ */

/* ---- Design Tokens ---- */
:root {
  /* Palette */
  --color-bg:          #F7F8FA;
  --color-surface:     #FFFFFF;
  --color-text:        #2D3142;
  --color-text-muted:  #6B7280;
  --color-border:      #E5E7EB;
  --color-accent:      #5B6ABF;
  --color-accent-soft: rgba(91, 106, 191, 0.10);
  --color-accent-hover:#4A58A5;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs:   0.75rem;
  --font-size-sm:   0.875rem;
  --font-size-base: 1rem;
  --font-size-lg:   1.125rem;
  --font-size-xl:   1.5rem;
  --font-size-2xl:  2rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
}

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

/* ---- Base ---- */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  line-height: 1.25;
  color: var(--color-text);
}

h1 { font-size: var(--font-size-2xl); font-weight: 700; }
h2 { font-size: var(--font-size-xl);  font-weight: 600; }
h3 { font-size: var(--font-size-lg);  font-weight: 600; }
h4 { font-size: var(--font-size-base); font-weight: 600; }

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

small {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ---- Utility: Container ---- */
.theme-container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-lg);
}

@media (min-width: 640px) {
  .theme-container {
    padding: var(--space-xl) var(--space-2xl);
  }
}

/* ---- Utility: Card ---- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ---- Utility: Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  padding: 0.55em 1.25em;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #fff;
}

/* ---- Utility: Inputs ---- */
.input {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  padding: 0.5em 0.75em;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  width: 100%;
}

.input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

/* Number input — hide spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* ---- Utility: Divider ---- */
.theme-divider {
  width: 40px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
  margin: var(--space-xl) auto;
  opacity: 0.5;
}

/* ---- Responsive helpers ---- */
@media (min-width: 640px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
}
