/* ============================================================
   MYDREAMS.APP — MAIN STYLESHEET
   Pacific Woods Colour System
   ============================================================ */

:root {
  --teal:         #2A9D8F;
  --teal-dark:    #1F7A6E;
  --teal-light:   #3DBDAD;
  --teal-pale:    #E8F4F2;
  --forest:       #1A3A3A;
  --forest-light: #2A5252;
  --bg:           #F4F7F6;
  --paper:        #FFFFFF;
  --text:         #1C1C1C;
  --text-light:   #6B7C7A;
  --text-muted:   #9BAEAB;
  --border:       rgba(42,157,143,0.18);
  --border-soft:  rgba(42,157,143,0.08);
  --shadow:       0 2px 12px rgba(26,58,58,0.08);
  --shadow-lg:    0 8px 32px rgba(26,58,58,0.12);
  --radius:       8px;
  --radius-sm:    4px;
  --success:      #4CAF50;
  --danger:       #E63946;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }

/* ─── NAV ─── */
.nav {
  background: var(--forest);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-icon {
  width: 34px; height: 34px;
  background: var(--teal);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 600;
  color: #FFF; letter-spacing: 0.02em;
}
.brand-name span { color: var(--teal-light); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active { color: #FFF; background: rgba(255,255,255,0.08); }
.nav-link.nav-cta { background: var(--teal); color: #FFF; padding: 8px 18px; }
.nav-link.nav-cta:hover { background: var(--teal-dark); color: #FFF; }
.nav-user { display: flex; align-items: center; gap: 14px; }
.nav-user-name { color: rgba(255,255,255,0.6); font-size: 13px; }
.nav-logout { color: rgba(255,255,255,0.45); font-size: 12px; letter-spacing: 0.04em; transition: color 0.2s; }
.nav-logout:hover { color: rgba(255,255,255,0.8); }

/* ─── LAYOUT ─── */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 40px 28px 80px; }
.page-wrap-narrow { max-width: 680px; margin: 0 auto; padding: 48px 28px 80px; }
.page-header { margin-bottom: 32px; }
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 600; color: var(--forest);
  line-height: 1.2; margin-bottom: 6px;
}
.page-subtitle { font-size: 14px; color: var(--text-light); }
.page-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ─── CARDS ─── */
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px; font-weight: 600; color: var(--forest);
}
.card-body { padding: 24px; }
.card-footer { padding: 14px 24px; border-top: 1px solid var(--border-soft); background: var(--teal-pale); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  text-decoration: none; padding: 10px 20px;
  border-radius: var(--radius-sm); border: 2px solid transparent;
  cursor: pointer; transition: all 0.2s; white-space: nowrap; line-height: 1;
}
.btn-primary { background: var(--teal); color: #FFF; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(42,157,143,0.3); color: #FFF; }
.btn-secondary { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn-secondary:hover { background: var(--teal-pale); color: var(--teal-dark); }
.btn-dark { background: var(--forest); color: #FFF; border-color: var(--forest); }
.btn-dark:hover { background: var(--forest-light); color: #FFF; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #FFF0F1; }
.btn-ghost { background: transparent; color: var(--text-light); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { font-size: 12px; padding: 6px 12px; }
.btn-lg { font-size: 15px; padding: 14px 32px; }
.btn-block { width: 100%; justify-content: center; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-light); margin-bottom: 7px;
}
.form-control {
  width: 100%; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; font-family: 'Inter', sans-serif;
  font-size: 14px; color: var(--text); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(42,157,143,0.1); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.6; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }
.form-section { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--border-soft); }
.form-section:last-child { border-bottom: none; }
.form-section-title {
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--teal-dark); margin-bottom: 18px;
}

/* ─── ALERTS ─── */
.alert {
  padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 20px; border-left: 4px solid transparent;
}
.alert-success { background: #E8F5E9; border-color: var(--success); color: #2E7D32; }
.alert-error   { background: #FFF0F1; border-color: var(--danger); color: #C62828; }
.alert-info    { background: var(--teal-pale); border-color: var(--teal); color: var(--teal-dark); }

/* ─── PROGRESS ─── */
.progress-wrap { background: var(--teal-pale); border-radius: 100px; height: 8px; overflow: hidden; }
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-light) 100%);
  border-radius: 100px; transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-bar.complete { background: linear-gradient(90deg, var(--success) 0%, #81C784 100%); }
.progress-label {
  font-size: 12px; font-weight: 600; color: var(--teal-dark);
  margin-bottom: 5px; display: flex; justify-content: space-between;
}

/* ─── BADGES ─── */
.badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px;
}
.badge-teal   { background: var(--teal-pale); color: var(--teal-dark); }
.badge-green  { background: #E8F5E9; color: #2E7D32; }
.badge-grey   { background: #F0F2F1; color: #666; }
.badge-forest { background: var(--forest); color: #FFF; }

/* ─── STAT ROW ─── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; text-align: center;
}
.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 38px; font-weight: 700; color: var(--teal);
  line-height: 1; margin-bottom: 5px;
}
.stat-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
}

/* ─── DREAM GRID ─── */
.dream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px; margin-top: 20px;
}
.dream-card {
  background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  text-decoration: none; display: block;
  transition: all 0.25s ease; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.dream-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--teal);
}
.dream-card.complete::before { background: var(--success); }
.dream-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(42,157,143,0.35); }
.dream-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px; font-weight: 600; color: var(--forest);
  margin-bottom: 7px; line-height: 1.3;
}
.dream-card-desc {
  font-size: 13px; color: var(--text-light); margin-bottom: 14px;
  line-height: 1.5; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dream-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; font-size: 12px; color: var(--text-muted);
}
.dream-card-progress { margin-top: 12px; }

/* ─── STEP LIST ─── */
.step-list { list-style: none; }
.step-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 10px; border-bottom: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); transition: background 0.15s;
}
.step-item:last-child { border-bottom: none; }
.step-item:hover { background: var(--teal-pale); }
.step-item.complete .step-title { text-decoration: line-through; color: var(--text-muted); }
.step-checkbox {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; margin-top: 1px; cursor: pointer; background: var(--bg);
}
.step-checkbox.checked { background: var(--teal); border-color: var(--teal); }
.step-checkbox.checked::after { content: '✓'; color: white; font-size: 11px; font-weight: 700; }
.step-title { font-size: 14px; font-weight: 500; color: var(--text); flex: 1; line-height: 1.4; }
.step-drag { color: var(--text-muted); cursor: grab; font-size: 14px; padding: 2px 4px; user-select: none; }
.step-drag:active { cursor: grabbing; }
.step-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.step-item:hover .step-actions { opacity: 1; }
.step-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26,58,58,0.55);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--paper); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); width: 100%;
  max-width: 520px; max-height: 90vh; overflow-y: auto;
  transform: translateY(16px); transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: 'Playfair Display', serif; font-size: 19px; font-weight: 600; color: var(--forest); }
.modal-close {
  background: none; border: none; font-size: 18px; color: var(--text-muted);
  cursor: pointer; padding: 4px 6px; border-radius: 4px; transition: all 0.15s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border-soft); display: flex; gap: 10px; justify-content: flex-end; }

/* ─── REWARD POPUP ─── */
.reward-overlay {
  position: fixed; inset: 0; background: rgba(26,58,58,0.7);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.reward-overlay.show { opacity: 1; pointer-events: all; }
.reward-box {
  background: var(--paper); border-radius: 16px;
  padding: 44px 36px; text-align: center; max-width: 380px; width: 90%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  transform: scale(0.9); transition: transform 0.3s;
}
.reward-overlay.show .reward-box { transform: scale(1); }
.reward-box .reward-icon { font-size: 60px; margin-bottom: 14px; }
.reward-box .reward-title {
  font-family: 'Playfair Display', serif; font-size: 26px;
  font-weight: 700; color: var(--forest); margin-bottom: 8px;
}
.reward-box .reward-text { color: var(--text-light); font-size: 14px; margin-bottom: 24px; }
.reward-box .reward-img { width: 110px; height: 110px; object-fit: cover; border-radius: 50%; margin: 0 auto 18px; display: block; }

/* ─── LOGIN PAGE ─── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 20px;
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-light) 100%);
}
.login-box {
  background: var(--paper); border-radius: 12px;
  padding: 48px 40px; width: 100%; max-width: 420px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon { font-size: 44px; display: block; margin-bottom: 12px; }
.login-logo h1 {
  font-family: 'Playfair Display', serif; font-size: 28px;
  font-weight: 700; color: var(--forest); margin-bottom: 4px;
}
.login-logo h1 span { color: var(--teal); }
.login-logo p { font-size: 14px; color: var(--text-light); }

/* ─── DETAIL SECTION ─── */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.detail-meta { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.detail-meta-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.detail-meta-row:last-child { border-bottom: none; }
.detail-meta-row th { color: var(--text-light); font-weight: 500; }
.detail-meta-row td { color: var(--text); font-weight: 600; text-align: right; }

/* ─── SHARE FORM ─── */
.share-options { display: flex; gap: 10px; margin-top: 12px; }
.share-btn {
  flex: 1; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer; text-align: center; transition: all 0.15s; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.share-btn:hover { background: var(--teal-pale); border-color: var(--teal); color: var(--teal-dark); }

/* ─── FOOTER ─── */
.site-footer {
  background: var(--forest); color: rgba(255,255,255,0.4);
  padding: 20px 32px; text-align: center; font-size: 12px;
  letter-spacing: 0.05em;
}
.footer-inner { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: rgba(255,255,255,0.5); text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: rgba(255,255,255,0.8); }
.footer-sep { color: rgba(255,255,255,0.2); }

/* ─── UTILS ─── */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.text-muted { color: var(--text-muted); }
.text-teal { color: var(--teal); }
.text-forest { color: var(--forest); }
.text-sm { font-size: 13px; } .text-xs { font-size: 11px; }
.font-serif { font-family: 'Playfair Display', serif; }
.font-bold { font-weight: 600; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.divider { border: none; border-top: 1px solid var(--border-soft); margin: 24px 0; }
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-light); }
.empty-state-icon { font-size: 44px; margin-bottom: 14px; opacity: 0.35; }
.empty-state h3 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 600; color: var(--forest); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 22px; }

/* ─── MOBILE ─── */
@media(max-width: 768px) {
  .nav { padding: 0 16px; }
  .nav-user-name { display: none; }
  .page-wrap, .page-wrap-narrow { padding: 24px 16px 60px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .dream-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .login-box { padding: 32px 24px; }
}
