/* ============================================
   LOVE LANGUAGE APP — Design System
   Dark premium theme matching Next.js version
   ============================================ */

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

:root {
  --color-bg:          #fafafa;
  --color-surface:     #ffffff;
  --color-surface-2:   #f4f4f4;
  --color-border:      #e5e7eb;
  --color-border-light:#f3f4f6;
  --color-text:        #1f2937;
  --color-muted:       #6b7280;
  --color-subtle:      #9ca3af;
  --color-pink:        #ec4899;
  --color-rose:        #f43f5e;
  --color-violet:      #8b5cf6;
  --color-emerald:     #10b981;
  --color-amber:       #f59e0b;
  --color-red:         #ef4444;
  --radius-sm:         12px;
  --radius-md:         16px;
  --radius-lg:         24px;
  --radius-xl:         32px;
  --shadow-card:       0 2px 10px rgba(0,0,0,0.05);
}

html { 
  font-size: 16px; 
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ============ LAYOUT ============ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px)  { .container { padding: 0 24px; } }
@media (min-width: 1024px) { .container { padding: 0 32px; } }

/* ============ BACKGROUND GLOWS ============ */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.bg-glow--pink   { background: rgba(236,72,153,0.07); width: 500px; height: 500px; }
.bg-glow--violet { background: rgba(139,92,246,0.07); width: 500px; height: 500px; }

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(2,6,23,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon {
  width: 24px; height: 24px;
  color: var(--color-pink);
  fill: var(--color-pink);
}
.logo-text {
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(90deg, #f472b6, #fb7185);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.site-header__actions { display: flex; align-items: center; gap: 16px; }
.session-badge {
  font-size: 12px;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 6px 12px;
  border-radius: 999px;
}
.hidden-mobile { display: none; }
@media (min-width: 768px) { .hidden-mobile { display: inline; } }

/* ============ DASHBOARD LAYOUT ============ */
.dashboard-body { position: relative; overflow-x: hidden; }
.dashboard-main { padding-top: 32px; padding-bottom: 64px; position: relative; z-index: 1; }

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.col-left {
  order: 2;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.col-right {
  order: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
@media (min-width: 1024px) {
  .dashboard-grid {
    display: grid;
    grid-template-columns: 7fr 5fr;
  }
  .col-left, .col-right {
    order: 0;
  }
}

/* ============ CARDS ============ */
.card {
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(30,41,59,0.8);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.card--report { /* no extra styles needed */ }
.card--streak {
  background: linear-gradient(135deg, rgba(236,72,153,0.12), rgba(139,92,246,0.04), rgba(15,23,42,0.5));
  border-color: rgba(236,72,153,0.2);
}
.card__glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.card__glow--tr {
  top: 0; right: 0;
  width: 128px; height: 128px;
  background: rgba(236,72,153,0.1);
  filter: blur(24px);
}
.card__glow--pulse {
  top: -40px; left: -40px;
  width: 128px; height: 128px;
  background: rgba(236,72,153,0.2);
  filter: blur(24px);
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:.6} 50%{opacity:1} }

/* ============ REPORT CARD ============ */
.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.report-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 900;
  margin-top: 12px;
  color: var(--color-text);
}
.report-icon-wrap {
  flex-shrink: 0;
  padding: 12px;
  background: rgba(236,72,153,0.1);
  border: 1px solid rgba(236,72,153,0.2);
  border-radius: var(--radius-md);
}
.report-icon { width: 24px; height: 24px; color: var(--color-pink); }
.report-description {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}
.divider {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 24px 0;
}
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-subtle);
  margin-bottom: 16px;
}

/* ============ SCORES ============ */
.scores-list { display: flex; flex-direction: column; gap: 16px; }
.score-row {}
.score-row__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
}
.score-row__name { font-weight: 600; color: var(--text-muted); }
.score-row__name--primary { color: var(--color-pink); font-weight: 700; }
.score-row__pts { color: var(--color-muted); }
.progress-bar {
  width: 100%;
  height: 10px;
  background: var(--color-bg);
  border-radius: 999px;
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--color-surface-2);
  transition: width 0.8s ease;
}
.progress-bar__fill--primary {
  background: linear-gradient(90deg, var(--color-pink), var(--color-rose));
  box-shadow: 0 0 8px rgba(236,72,153,0.3);
}

/* ============ CARD TITLE ROW ============ */
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}
.card-subtitle {
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 24px;
  margin-top: 4px;
}
.card-icon { width: 22px; height: 22px; }
.card-icon--pink   { color: var(--color-pink); }
.card-icon--violet { color: var(--color-violet); }

/* ============ CHECK-IN ============ */
.checkin-moods {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 0;
}
.checkin-form { display: contents; }
.mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  gap: 4px;
}
.mood-btn:hover {
  background: rgba(236,72,153,0.08);
  border-color: rgba(236,72,153,0.3);
  transform: translateY(-2px);
}
.mood-emoji { font-size: 24px; line-height: 1; transition: transform 0.2s; }
.mood-btn:hover .mood-emoji { transform: scale(1.15); }
.mood-label { font-size: 10px; color: var(--color-muted); }
.mood-btn:hover .mood-label { color: var(--action-primary); }

.checkin-history { margin-top: 32px; }
.empty-state {
  font-size: 12px;
  color: var(--color-subtle);
  text-align: center;
  padding: 16px;
  background: rgba(15,23,42,0.4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.checkin-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.checkin-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 7px 14px;
  border-radius: var(--radius-xl);
  font-size: 12px;
  transition: border-color 0.2s;
}
.checkin-chip:hover { border-color: var(--color-border-light); }
.checkin-chip__emoji { font-size: 18px; }
.checkin-chip__date  { color: var(--color-muted); font-weight: 500; }

/* ============ STREAK CARD ============ */
.streak-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.streak-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--action-primary);
}
.streak-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}
.streak-number {
  font-size: 56px;
  font-weight: 900;
  color: white;
  line-height: 1;
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
.streak-unit { font-size: 14px; color: var(--color-muted); }
.streak-flame {
  padding: 16px;
  background: var(--color-pink);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(236,72,153,0.35);
  animation: pulse 2s ease-in-out infinite;
}
.streak-flame svg { width: 32px; height: 32px; color: white; fill: white; }
.streak-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}
.streak-actions form { display: contents; }

/* ============ TASK CARD ============ */
.task-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.task-tabs::-webkit-scrollbar { display: none; }
.task-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--color-bg);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  transition: all 0.2s;
}
.task-tab:hover { background: var(--color-surface); color: white; }
.task-tab--active { background: var(--color-pink); color: white; border-color: transparent; }
.task-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.task-text {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.7;
  font-style: italic;
  font-weight: 500;
}
.task-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 10px;
  color: var(--color-subtle);
}

/* ============ SUBSCRIPTION ============ */
.subscription-details { display: flex; flex-direction: column; }
.sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}
.sub-row:last-child { border-bottom: 0; }
.sub-row__key { color: var(--color-muted); }
.sub-row__val { font-weight: 600; color: var(--ink); }

/* ============ ALERTS ============ */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  border: 1px solid transparent;
  margin-bottom: 24px;
}
.alert--dismissible { justify-content: space-between; }
.alert__body { display: flex; align-items: center; gap: 10px; }
.alert--success { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); color: #15803d; }
.alert--error   { background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.2);  color: #b91c1c; }
.alert--warning { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2); color: #b45309; }
.alert--sm      { padding: 10px 14px; font-size: 12px; border-radius: var(--radius-sm); margin-top: 16px; margin-bottom: 0; }
.alert__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.alert--success .alert__dot { background: var(--color-emerald); }
.alert--error   .alert__dot { background: var(--color-red); }

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge--pink-outline { background: rgba(236,72,153,0.1); border: 1px solid rgba(236,72,153,0.2); color: var(--action-primary); }
.badge--green  { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: #15803d; }
.badge--amber  { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); color: #b45309; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  padding: 12px 20px;
  font-size: 14px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--full { width: 100%; }
.btn--sm   { padding: 10px 16px; font-size: 12px; }
.btn--primary {
  background: linear-gradient(90deg, var(--color-pink), var(--color-rose));
  color: white;
  box-shadow: 0 4px 14px rgba(236,72,153,0.25);
}
.btn--primary:hover { opacity: 0.9; box-shadow: 0 6px 20px rgba(236,72,153,0.35); transform: translateY(-1px); }
.btn--gradient {
  background: linear-gradient(90deg, var(--color-pink), var(--color-rose), var(--color-violet));
  color: white;
  box-shadow: 0 4px 14px rgba(236,72,153,0.25);
}
.btn--gradient:hover { opacity: 0.9; transform: translateY(-1px); }
.btn--white {
  background: white;
  color: #0f172a;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.btn--white:hover { background: #f1f5f9; }
.btn--ghost {
  background: var(--color-bg);
  color: var(--color-muted);
  border-color: var(--color-border);
}
.btn--ghost:hover { background: var(--color-surface); color: white; }
.btn--danger {
  background: rgba(239,68,68,0.1);
  color: #b91c1c;
  border-color: rgba(239,68,68,0.2);
}
.btn--danger:hover { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.35); }
.btn--red { background: #dc2626; color: white; }
.btn--red:hover { background: #b91c1c; }

.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon-only:hover { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); color: #b91c1c; }
.btn-icon-only svg { width: 20px; height: 20px; }
.btn-icon-only--sm { width: 30px; height: 30px; }
.btn-icon-only--sm:hover { background: var(--color-surface); border-color: var(--color-border); color: white; }
.btn-icon-only--sm svg { width: 16px; height: 16px; }
.btn-link {
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  transition: color 0.2s;
}
.btn-link:hover { color: var(--color-pink); }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2,6,23,0.85);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:none;opacity:1} }
.modal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-title  { font-size: 20px; font-weight: 800; color: var(--color-text); }
.modal-body   { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 16px; }

/* ============ LOGIN PAGE ============ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.login-wrapper { width: 100%; max-width: 440px; position: relative; z-index: 1; }
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo-wrap {
  display: inline-flex;
  padding: 14px;
  background: rgba(236,72,153,0.1);
  border: 1px solid rgba(236,72,153,0.2);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: 0 0 24px rgba(236,72,153,0.08);
  animation: pulse 3s ease-in-out infinite;
}
.login-logo-icon {
  width: 36px; height: 36px;
  color: var(--color-pink);
  fill: var(--color-pink);
}
.login-title {
  font-size: clamp(24px, 6vw, 36px);
  font-weight: 900;
  background: linear-gradient(90deg, #f472b6, #fb7185, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}
.login-subtitle {
  margin-top: 8px;
  font-size: 14px;
  color: var(--color-muted);
}
.login-card {
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(24px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.login-form { display: flex; flex-direction: column; gap: 24px; }
.login-back  { text-align: center; margin-top: 8px; }

/* ============ FORM ELEMENTS ============ */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.input-wrap { position: relative; }
.input-icon {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  padding-left: 14px;
  display: flex;
  align-items: center;
  color: var(--color-subtle);
  pointer-events: none;
}
.input-icon svg { width: 20px; height: 20px; }
.form-input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: white;
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
}
.form-input::placeholder { color: var(--color-subtle); }
.form-input:focus {
  border-color: var(--color-pink);
  box-shadow: 0 0 0 3px rgba(236,72,153,0.12);
  background: rgba(15,23,42,0.8);
}
.form-input--otp {
  text-align: center;
  letter-spacing: 0.35em;
  font-weight: 700;
  font-size: 20px;
}
.form-hint { font-size: 12px; color: var(--color-subtle); }
.btn-icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ============ RESPONSIVE TWEAKS ============ */
@media (max-width: 480px) {
  .card { padding: 20px; }
  .login-card { padding: 24px; }
  .checkin-moods { gap: 8px; }
  .mood-btn { padding: 10px 4px; }
  .mood-emoji { font-size: 20px; }
  .streak-number { font-size: 44px; }
  .streak-actions { grid-template-columns: 1fr; }
}
