:root {
  --bg: #0a0e1a;
  --bg-card: #111627;
  --bg-card-hover: #161d33;
  --bg-input: #1a2140;
  --bg-input-focus: #1e2750;
  --text: #f0f2f8;
  --text-secondary: #c5cae0;
  --text-muted: #9ca3c0;
  --purple: #9333ea;
  --purple-light: #a855f7;
  --blue: #2563eb;
  --blue-light: #3b82f6;
  --gradient: linear-gradient(135deg, #9333ea 0%, #6d28d9 35%, #4f46e5 65%, #2563eb 100%);
  --gradient-btn: linear-gradient(135deg, #9333ea 0%, #7c3aed 40%, #4f46e5 70%, #2563eb 100%);
  --gradient-glow: linear-gradient(135deg, rgba(147, 51, 234, 0.4) 0%, rgba(37, 99, 235, 0.4) 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(147, 51, 234, 0.08) 0%, rgba(37, 99, 235, 0.08) 100%);
  --danger: #ef4444;
  --danger-hover: #f87171;
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --border: #1e2645;
  --border-light: #2a3358;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px -8px rgba(124, 58, 237, 0.25);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ====== SKIP NAV ====== */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 10px 18px;
  background: var(--gradient-btn);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
  transition: top 0.2s;
}

.skip-nav:focus {
  top: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(147, 51, 234, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(37, 99, 235, 0.05) 0%, transparent 50%);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-light); text-decoration: none; }
a:hover { color: var(--purple-light); }

/* ====== LAYOUT ====== */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

/* ====== NAV ====== */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(17, 22, 39, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.nav-brand img {
  height: 32px;
  width: 32px;
  border-radius: 8px;
  object-fit: cover;
  filter: brightness(1.3) drop-shadow(0 0 6px rgba(147, 51, 234, 0.5));
  box-shadow: 0 0 0 1.5px rgba(147, 51, 234, 0.45), 0 0 14px rgba(147, 51, 234, 0.25);
}

.nav-brand-text {
  font-size: 1.125rem;
  font-weight: 700;
  background: linear-gradient(135deg, #9333ea 0%, #6d28d9 25%, #4f46e5 50%, #2563eb 75%, #9333ea 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShine 4s linear infinite;
}

@keyframes textShine {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-links a, .nav-links button {
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-links a:hover, .nav-links button:hover {
  color: var(--text);
  background: var(--bg-input);
}

.nav-links a.active {
  color: var(--purple-light);
  background: rgba(147, 51, 234, 0.1);
}

/* ====== CARDS ====== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-header {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  color: var(--text-muted);
}

/* ====== FORMS ====== */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--purple);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
}

.form-group input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--gradient-btn);
  color: white;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-light);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--purple);
  color: var(--purple-light);
  background: rgba(147, 51, 234, 0.06);
}

.btn-sm { padding: 8px 14px; font-size: 0.8rem; }

.btn-block { width: 100%; }

/* ====== REMINDER ITEMS ====== */
.reminder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.reminder-item:active {
  background: var(--bg-card-hover);
}

.reminder-info { flex: 1; min-width: 0; }

.reminder-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-bottom: 3px;
}

.reminder-message {
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

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

.reminder-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.badge-recurring {
  background: rgba(147, 51, 234, 0.15);
  color: var(--purple-light);
}

.badge-onetime {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.reminder-actions { flex-shrink: 0; margin-left: 10px; }

/* ====== TRIAL BANNER ====== */
.trial-banner {
  background: var(--gradient-btn);
  color: white;
  padding: 10px 16px;
  text-align: center;
  font-weight: 600;
  font-size: 0.82rem;
}

.trial-banner a {
  color: white;
  text-decoration: underline;
  font-weight: 700;
}

/* ====== BILLING ====== */
.plan-card {
  text-align: center;
  padding: 28px 20px;
  border-color: rgba(147, 51, 234, 0.3);
  background: var(--gradient-subtle);
}

.plan-card .plan-logo {
  height: 56px;
  width: 56px;
  border-radius: 14px;
  object-fit: cover;
  margin-bottom: 12px;
}

.plan-price {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.plan-price span {
  font-size: 0.9rem;
  font-weight: 500;
  -webkit-text-fill-color: var(--text-muted);
}

.plan-features {
  list-style: none;
  margin: 20px 0;
  text-align: left;
}

.plan-features li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.plan-features li::before {
  content: "\2713";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ====== TIER GRID ====== */
.tier-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tier-card {
  position: relative;
  text-align: center;
  padding: 24px 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tier-card.tier-featured {
  border-color: rgba(147, 51, 234, 0.4);
  background: var(--gradient-subtle);
  box-shadow: var(--shadow-glow);
}

.tier-card.tier-current {
  border-color: rgba(16, 185, 129, 0.4);
}

.tier-popular {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-btn);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 12px;
  border-radius: 0 0 8px 8px;
}

.tier-name {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px;
  margin-top: 8px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ====== BILLING TOGGLE ====== */
.billing-toggle {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 12px;
}

.billing-option {
  flex: 1;
  padding: 10px 14px;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.billing-option.active {
  background: var(--gradient-btn);
  color: white;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.save-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.annual-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.save-percent {
  color: var(--success);
  font-weight: 700;
}

.price-crossed {
  text-decoration: line-through;
  opacity: 0.5;
  font-size: 1.2rem;
  margin-right: 4px;
}

.tier-card .plan-price {
  font-size: 2rem;
  margin-bottom: 4px;
}

.tier-card .plan-features {
  margin: 14px 0;
  text-align: left;
}

.tier-card .plan-features li {
  padding: 7px 0;
  font-size: 0.82rem;
}

.tier-btn-wrap {
  margin-top: auto;
}

.tier-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ====== STATUS BADGES ====== */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-active { background: var(--success-bg); color: var(--success); }
.status-trialing { background: rgba(147, 51, 234, 0.12); color: var(--purple-light); }
.status-past_due { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.status-canceled { background: rgba(123, 132, 163, 0.12); color: var(--text-muted); }

/* ====== INPUT BAR ====== */
.input-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.input-bar input {
  flex: 1;
  padding: 13px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
}

.input-bar input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
  outline: none;
}

.input-bar .btn { padding: 13px 18px; flex-shrink: 0; }

/* ====== AUTH PAGE ====== */
.auth-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px 16px;
  min-height: calc(100vh - 54px);
  min-height: calc(100dvh - 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-hero {
  text-align: center;
  margin-bottom: 28px;
}

.auth-hero .logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 4px;
  overflow: hidden;
  border-radius: 48px;
}

.auth-hero img {
  height: 260px;
  width: 260px;
  border-radius: 48px;
  object-fit: cover;
  animation: logoFloat 4s ease-in-out infinite, logoRotateIn 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  filter: drop-shadow(0 0 20px rgba(147, 51, 234, 0.4)) drop-shadow(0 0 40px rgba(37, 99, 235, 0.2));
}

/* Light glare sweep */
.auth-hero .logo-wrap::after {
  content: '';
  position: absolute;
  top: 0; left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.15) 45%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0.15) 55%,
    transparent 80%
  );
  border-radius: 48px;
  animation: glare 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes logoRotateIn {
  0% { transform: rotate(-180deg) scale(0.3); opacity: 0; }
  100% { transform: rotate(0deg) scale(1); opacity: 1; }
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes glare {
  0%, 100% { left: -50%; opacity: 0; }
  15% { opacity: 1; }
  50% { left: 120%; opacity: 1; }
  65%, 100% { opacity: 0; }
}

.auth-hero h1 {
  margin-top: 14px;
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-hero p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.25s;
}

.auth-tab.active {
  background: var(--gradient-btn);
  color: white;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* ====== EMPTY STATE ====== */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.5;
}

.empty-state p { margin-bottom: 8px; font-size: 0.9rem; }

/* ====== ALERTS ====== */
.alert {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: min(90%, 500px);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.alert a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ====== PARSE PREVIEW ====== */
.parse-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 10px 12px;
  background: var(--gradient-subtle);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.25s;
}

.parse-preview.parsed-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--text-secondary);
}

.parse-preview .parse-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--success);
  margin-bottom: 3px;
}

.parse-preview.parse-placeholder {
  color: var(--text-muted);
  opacity: 0.7;
  font-style: italic;
}

/* ====== QUICK CHIPS ====== */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.quick-chip {
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.quick-chip:hover {
  border-color: var(--purple);
  color: var(--purple-light);
  background: rgba(147, 51, 234, 0.08);
}

.quick-chip:active {
  transform: scale(0.96);
}

.quick-chip.chip-active {
  border-color: var(--purple);
  color: #fff;
  background: rgba(147, 51, 234, 0.25);
  box-shadow: 0 0 0 1px var(--purple);
}

.form-label-sm {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ====== SCHEDULING ROW ====== */
.schedule-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.schedule-row select,
.schedule-row input[type="time"],
.schedule-row input[type="datetime-local"] {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s;
  -webkit-appearance: none;
}

.schedule-row select:focus,
.schedule-row input[type="time"]:focus,
.schedule-row input[type="datetime-local"]:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
}

/* color-scheme for native inputs on dark bg */
.schedule-row input[type="time"],
.schedule-row input[type="datetime-local"] {
  color-scheme: dark;
}

.schedule-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 10px;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.schedule-or::before,
.schedule-or::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ====== INPUT HINT ====== */
.input-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.65;
  margin-top: 4px;
  line-height: 1.5;
}

/* ====== SECTION DIVIDER ====== */
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* ====== MODAL ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  animation: fadeIn 0.2s ease-out;
}

.modal-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.modal-body {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-body p { margin-bottom: 6px; }

.modal-body input {
  width: 100%;
  padding: 10px 12px;
  margin-top: 4px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.modal-body input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ====== LOADING STATE ====== */
.item-loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.15s;
}

/* ====== PHONE HINT ====== */
.phone-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.75;
}

.verify-phone-row,
.phone-verify-row {
  display: flex;
  gap: 8px;
}
.verify-phone-row input,
.phone-verify-row input {
  flex: 1;
}
.verify-phone-row .btn,
.phone-verify-row .btn {
  white-space: nowrap;
  font-size: 0.8rem;
  padding: 8px 14px;
}
.btn-sm {
  font-size: 0.8rem;
  padding: 8px 14px;
}
.btn-sm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sms-consent-group {
  margin-top: 12px;
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
}

/* ====== FOCUS VISIBLE ====== */
:focus-visible {
  outline: 2px solid var(--purple-light);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ====== UTILITIES ====== */
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8rem; }

/* ====== SAFE AREA (NOTCH) ====== */
@supports (padding-top: env(safe-area-inset-top)) {
  .nav {
    padding-top: calc(10px + env(safe-area-inset-top));
  }
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ====== FOOTER ====== */
.site-footer {
  text-align: center;
  padding: 20px 16px 32px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--purple-light);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 480px) {
  .container { padding: 12px; }
  .nav { padding: 8px 12px; }
  .nav-brand img { height: 28px; width: 28px; }
  .nav-brand-text { font-size: 1rem; }
  .card { padding: 16px; border-radius: 14px; }
  .auth-hero img { height: 200px; width: 200px; border-radius: 40px; }
  .auth-hero h1 { font-size: 1.4rem; }
  .reminder-item { padding: 12px; }
  .plan-price { font-size: 2.2rem; }
  .quick-chips { gap: 5px; }
  .quick-chip { font-size: 0.68rem; padding: 4px 8px; }
}

@media (min-width: 481px) and (max-width: 768px) {
  .container { max-width: 560px; }
}

@media (min-width: 769px) {
  .container { max-width: 640px; }
  .auth-container { max-width: 420px; }
}

/* ====== ANIMATIONS ====== */

/* --- Staggered card entrance --- */
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card {
  animation: cardReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
.card:nth-child(4) { animation-delay: 0.24s; }
.card:nth-child(5) { animation-delay: 0.32s; }

/* --- Card hover glow --- */
.card:hover {
  border-color: rgba(147, 51, 234, 0.2);
  box-shadow: 0 4px 24px -4px rgba(147, 51, 234, 0.08), 0 0 0 1px rgba(147, 51, 234, 0.06);
}

/* --- Nav slide down on load --- */
@keyframes navSlide {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}

.nav { animation: navSlide 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* --- Nav brand pulse on hover --- */
.nav-brand:hover img {
  filter: brightness(1.5) drop-shadow(0 0 10px rgba(147, 51, 234, 0.7));
  transform: scale(1.08);
}

.nav-brand img {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reminder item stagger + hover --- */
@keyframes itemSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.reminder-item {
  animation: itemSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.reminder-item:nth-child(1) { animation-delay: 0s; }
.reminder-item:nth-child(2) { animation-delay: 0.05s; }
.reminder-item:nth-child(3) { animation-delay: 0.1s; }
.reminder-item:nth-child(4) { animation-delay: 0.15s; }
.reminder-item:nth-child(5) { animation-delay: 0.2s; }
.reminder-item:nth-child(6) { animation-delay: 0.25s; }
.reminder-item:nth-child(7) { animation-delay: 0.3s; }
.reminder-item:nth-child(8) { animation-delay: 0.35s; }

.reminder-item:hover {
  border-color: rgba(147, 51, 234, 0.25);
  background: var(--bg-card-hover);
  transform: translateX(4px);
  box-shadow: -3px 0 0 0 var(--purple);
}

/* --- Button press / ripple --- */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.btn:active::after {
  opacity: 1;
  transition: opacity 0s;
}

.btn-primary {
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn-outline:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.15);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* --- Input focus glow pulse --- */
@keyframes focusPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.12); }
  50% { box-shadow: 0 0 0 5px rgba(147, 51, 234, 0.08); }
}

.form-group input:focus,
.form-group select:focus,
.input-bar input:focus {
  animation: focusPulse 2s ease-in-out infinite;
}

/* --- Badge subtle pulse --- */
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.badge-recurring {
  animation: badgePulse 2.5s ease-in-out infinite;
}

/* --- Quick chip hover lift --- */
.quick-chip {
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quick-chip:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.15);
}

/* --- Auth tabs slide indicator --- */
.auth-tab {
  position: relative;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-tab.active {
  transform: scale(1.02);
}

/* --- Toast notification --- */
.alert { animation: toastSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translate(-50%, -30px) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* --- Modal entrance --- */
@keyframes modalBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-overlay { animation: modalBackdrop 0.2s ease-out; }
.modal-box { animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* --- Trial banner shimmer --- */
@keyframes bannerShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.trial-banner {
  background-size: 200% 100%;
  animation: bannerShimmer 6s linear infinite;
}

/* --- Plan card hover lift --- */
.tier-card {
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.tier-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px -8px rgba(147, 51, 234, 0.2);
  border-color: rgba(147, 51, 234, 0.3);
}

.tier-featured:hover {
  box-shadow: 0 16px 48px -8px rgba(147, 51, 234, 0.3);
}

/* --- Status badge glow --- */
.status-active {
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.status-trialing {
  animation: badgePulse 2s ease-in-out infinite;
}

/* --- Parse preview success entrance --- */
.parsed-success {
  animation: parseReveal 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes parseReveal {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Skeleton shimmer for loading --- */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* --- Smooth page transition --- */
.container {
  animation: cardReveal 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* Sister sites footer on the landing page */
.site-links {
  max-width: 640px;
  margin: 32px auto 0;
  padding: 20px 16px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  font-size: 13px;
}
.site-links-label {
  flex: 1 0 100%;
  margin: 0 0 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.site-links a {
  color: var(--text-muted);
  text-decoration: none;
}
.site-links a:hover {
  color: var(--text);
}
