/* ============================================================
   WEEKLISTO — Global Design System
   Minimaliste · Premium · TeuxDeux-inspired
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
  /* Brand */
  --primary:       #01696F;
  --primary-light: #cedcd8;
  --primary-dim:   rgba(1,105,111,0.08);
  --primary-dim2:  rgba(1,105,111,0.05);
  --primary-border:rgba(1,105,111,0.20);

  /* Neutrals */
  --bg:           #f7f6f2;
  --bg-subtle:    #f9f8f5;
  --bg-muted:     #e7e5e0;
  --border:       #e8e6df;
  --border-mid:   #dcd9d0;

  /* Text */
  --text:         #1E1B3A;
  --text-muted:   #6B6892;
  --text-faint:   #A8A5C2;

  /* Status */
  --green:        #059669;
  --green-dim:    rgba(5,150,105,0.08);
  --red:          #DC2626;
  --red-dim:      rgba(220,38,38,0.08);
  --amber:        #D97706;
  --amber-dim:    rgba(217,119,6,0.08);
  --blue:         #2563EB;
  --blue-dim:     rgba(37,99,235,0.08);

  /* Typography */
  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --text-xs:      0.70rem;
  --text-sm:      0.825rem;
  --text-base:    0.9375rem;
  --text-lg:      1.125rem;
  --text-xl:      1.375rem;
  --text-2xl:     1.75rem;
  --text-3xl:     2.25rem;

  /* Spacing */
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    16px;
  --radius-xl:    22px;
  --radius-full:  9999px;

  /* Shadows */
  --shadow-xs:    0 1px 3px rgba(30,27,58,0.06);
  --shadow-sm:    0 2px 8px rgba(30,27,58,0.08);
  --shadow:       0 4px 16px rgba(30,27,58,0.10);
  --shadow-lg:    0 12px 40px rgba(30,27,58,0.12);
  --shadow-primary: 0 6px 24px rgba(1,105,111,0.25);

  /* Transitions */
  --t:            0.18s cubic-bezier(0.4,0,0.2,1);
  --t-slow:       0.32s cubic-bezier(0.4,0,0.2,1);
}

/* ── Dark mode ────────────────────────────────────────────── */
[data-theme="dark"],
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary:        #2bbfc6;
    --primary-light:  #1e5459;
    --primary-dim:    rgba(43,191,198,0.12);
    --primary-dim2:   rgba(43,191,198,0.07);
    --primary-border: rgba(43,191,198,0.25);

    --bg:           #12111a;
    --bg-subtle:    #1a1926;
    --bg-muted:     #252333;
    --border:       #2e2c3e;
    --border-mid:   #3a3850;

    --text:         #eeedf8;
    --text-muted:   #9997b8;
    --text-faint:   #5e5c7a;

    --green:        #34d399;
    --green-dim:    rgba(52,211,153,0.12);
    --red:          #f87171;
    --red-dim:      rgba(248,113,113,0.12);
    --amber:        #fbbf24;
    --amber-dim:    rgba(251,191,36,0.12);
    --blue:         #60a5fa;
    --blue-dim:     rgba(96,165,250,0.12);

    --shadow-xs:    0 1px 3px rgba(0,0,0,0.35);
    --shadow-sm:    0 2px 8px rgba(0,0,0,0.4);
    --shadow:       0 4px 16px rgba(0,0,0,0.45);
    --shadow-lg:    0 12px 40px rgba(0,0,0,0.5);
    --shadow-primary: 0 6px 24px rgba(43,191,198,0.3);
  }
}

[data-theme="dark"] {
    --primary:        #2bbfc6;
    --primary-light:  #1e5459;
    --primary-dim:    rgba(43,191,198,0.12);
    --primary-dim2:   rgba(43,191,198,0.07);
    --primary-border: rgba(43,191,198,0.25);

    --bg:           #12111a;
    --bg-subtle:    #1a1926;
    --bg-muted:     #252333;
    --border:       #2e2c3e;
    --border-mid:   #3a3850;

    --text:         #eeedf8;
    --text-muted:   #9997b8;
    --text-faint:   #5e5c7a;

    --green:        #34d399;
    --green-dim:    rgba(52,211,153,0.12);
    --red:          #f87171;
    --red-dim:      rgba(248,113,113,0.12);
    --amber:        #fbbf24;
    --amber-dim:    rgba(251,191,36,0.12);
    --blue:         #60a5fa;
    --blue-dim:     rgba(96,165,250,0.12);

    --shadow-xs:    0 1px 3px rgba(0,0,0,0.35);
    --shadow-sm:    0 2px 8px rgba(0,0,0,0.4);
    --shadow:       0 4px 16px rgba(0,0,0,0.45);
    --shadow-lg:    0 12px 40px rgba(0,0,0,0.5);
    --shadow-primary: 0 6px 24px rgba(43,191,198,0.3);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size:   var(--text-base);
  color:       var(--text);
  background:  var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); cursor: pointer; border: none; }
input, select, textarea { font-family: var(--font); font-size: var(--text-base); }
ul, ol { list-style: none; }
h1,h2,h3,h4 { letter-spacing: -0.025em; line-height: 1.25; }

/* ── Logo ─────────────────────────────────────────────────── */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  user-select: none;
}
.logo-icon {
  width:  36px;
  height: 36px;
  flex-shrink: 0;
}
.logo-text {
  font-size:   1.2rem;
  font-weight: 800;
  color:       var(--text);
  letter-spacing: -0.03em;
}
.logo:hover { text-decoration: none; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display:     inline-flex;
  align-items: center;
  justify-content: center;
  gap:         7px;
  padding:     11px 22px;
  border-radius: var(--radius-full);
  font-size:   var(--text-sm);
  font-weight: 700;
  transition:  all var(--t);
  cursor:      pointer;
  white-space: nowrap;
  border:      1.5px solid transparent;
  font-family: var(--font);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #05898F);
  border: none;
  padding: 12.5px 23.5px; /* Adjust padding due to removed border */
  color:      #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover  { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(1,105,111,0.35); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background:   transparent;
  color:        var(--primary);
  border-color: var(--primary-border);
}
.btn-outline:hover { background: var(--primary-dim); }

.btn-ghost {
  background:   var(--bg-subtle);
  color:        var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-muted); color: var(--text); }

.btn-danger {
  background: var(--red-dim);
  color:      var(--red);
  border-color: rgba(220,38,38,0.2);
}
.btn-danger:hover { background: rgba(220,38,38,0.14); }

.btn-sm  { padding: 7px 14px; font-size: var(--text-xs); }
.btn-lg  { padding: 14px 28px; font-size: var(--text-base); }
.btn-full { width: 100%; }

.btn:disabled, .btn[disabled] {
  opacity: 0.55;
  cursor:  not-allowed;
  transform: none !important;
}

/* ── Form inputs ──────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size:   var(--text-xs);
  font-weight: 700;
  color:       var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.form-input, .form-select, .form-textarea {
  width:       100%;
  background:  var(--bg-subtle);
  border:      1.5px solid var(--border);
  border-radius: var(--radius);
  color:       var(--text);
  padding:     11px 14px;
  font-size:   var(--text-base);
  outline:     none;
  transition:  all var(--t);
  font-family: var(--font);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-faint); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  background:   #fff;
  box-shadow:   0 0 0 3px var(--primary-dim);
}
.form-input.error, .form-select.error { border-color: var(--red); }
.form-message {
  font-size:  var(--text-xs);
  margin-top: 3px;
}
.form-message.error   { color: var(--red); }
.form-message.success { color: var(--green); }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-select { cursor: pointer; color-scheme: light; }

/* ── Alert/Flash ──────────────────────────────────────────── */
.alert {
  display:     flex;
  align-items: flex-start;
  gap:         10px;
  padding:     12px 16px;
  border-radius: var(--radius);
  font-size:   var(--text-sm);
  font-weight: 500;
  margin-bottom: 16px;
}
.alert[hidden] { display: none; }
.alert.error   { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(220,38,38,0.25); }
.alert.success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(5,150,105,0.25); }
.alert.info    { background: var(--primary-dim); color: var(--primary); border: 1px solid var(--primary-border); }
.alert.warning { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(217,119,6,0.25); }

/* ── Badge / Status pill ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.badge-trial     { background: var(--amber-dim);  color: var(--amber); }
.badge-active    { background: var(--green-dim);  color: var(--green); }
.badge-promo     { background: var(--primary-dim); color: var(--primary); }
.badge-expired   { background: var(--red-dim);    color: var(--red); }
.badge-suspended { background: rgba(30,27,58,0.06); color: var(--text-muted); }
.badge-canceled  { background: rgba(30,27,58,0.06); color: var(--text-muted); }
.badge-past_due  { background: var(--red-dim);    color: var(--red); }

/* ── Tooltips ─────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  background: var(--text);
  color: var(--bg);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: none;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ── Trial countdown banner ───────────────────────────────── */
.trial-banner {
  display:     flex;
  align-items: center;
  justify-content: center;
  gap:         10px;
  padding:     8px 20px;
  background:  linear-gradient(135deg, rgba(1,105,111,0.06), rgba(12,78,84,0.06));
  border-bottom: 1px solid var(--primary-border);
  font-size:   var(--text-xs);
  font-weight: 600;
  color:       var(--primary);
}
.trial-banner[hidden] {
  display: none !important;
}
.trial-banner.expiring-soon { background: rgba(217,119,6,0.06); border-color: rgba(217,119,6,0.25); color: var(--amber); }
.trial-banner.expired-banner { background: var(--red-dim); border-color: rgba(220,38,38,0.2); color: var(--red); }
.trial-banner a { color: inherit; font-weight: 700; text-decoration: underline; }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  width:  18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner-dark {
  border-color: var(--primary-dim);
  border-top-color: var(--primary);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 22px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Responsive utilities ─────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: var(--text-sm); }
.fw-700      { font-weight: 700; }
.mt-4  { margin-top:  1rem; }
.mb-4  { margin-bottom: 1rem; }
.gap-2 { gap: 0.5rem; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ── Day Off checkbox labels (account settings) ───────────── */
.day-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t);
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.day-checkbox-label:has(input:checked) {
  background: var(--primary-dim);
  border-color: var(--primary-border);
  color: var(--primary);
}
.day-checkbox-label input { display: none; }

/* ── Theme transition ─────────────────────────────────────── */
*, *::before, *::after {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}
/* Don't slow down animations that aren't theme-related */
.btn, .spinner, [class*="animation"], [class*="animate"] {
  transition: all var(--t) !important;
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Dark mode input/select overrides ─────────────────────── */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
  background: var(--bg-muted);
  color: var(--text);
  border-color: var(--border);
  color-scheme: dark;
}
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-textarea:focus {
  background: var(--bg-subtle);
}
[data-theme="dark"] .btn-ghost {
  background: var(--bg-muted);
  border-color: var(--border);
  color: var(--text-muted);
}
[data-theme="dark"] .btn-ghost:hover {
  background: var(--border);
  color: var(--text);
}



/* ── Google Sign-In button ────────────────────────────────────────── */
.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 340px;
  height: 44px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: #3c4043;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  cursor: pointer;
}
.google-signin-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
