/* Room Parent — Design System
   New visual identity: Outfit + Lora fonts, warm palette, rounded cards.
   Replaces old Fraunces + DM Sans design. */

/* ——— Design Tokens ——— */
:root {
  --primary: #3B7A6B;
  --primary-dark: #2C5F53;
  --primary-light: #E6F2EF;
  --accent-purple: #7C6BAF;
  --accent-purple-light: #F3F0FA;
  --cta: #E8854A;
  --cta-hover: #D4763C;
  --dark-section: #1F2D32;
  --hero-bg: #F0EDE8;
  --page-bg: #FFFAF5;
  --surface: #FFFFFF;
  --border: #E8E3DD;
  --text-primary: #1F2D32;
  --text-secondary: #5C6B71;
  --text-muted: #94A3AB;
}

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

html, body {
  height: 100%;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.font-serif { font-family: 'Lora', serif; }

/* ——— SVG Icon Helper ——— */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ——— Typography ——— */
.section-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.section-title {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
}
.section-desc {
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-cta {
  background: var(--cta);
  color: #fff;
  border-radius: 999px;
  padding: 18px 36px;
  font-size: 17px;
}
.btn-cta:hover { background: var(--cta-hover); }

.btn-cta-rect {
  background: var(--cta);
  color: #fff;
  border-radius: 12px;
  padding: 0 24px;
  height: 52px;
  font-size: 16px;
  width: 100%;
}
.btn-cta-rect:hover { background: var(--cta-hover); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 15px;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-primary-full {
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  height: 52px;
  font-size: 16px;
  width: 100%;
}
.btn-primary-full:hover { background: var(--primary-dark); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 999px;
  padding: 18px 36px;
  font-size: 17px;
}
.btn-outline:hover { background: var(--primary-light); }

.btn-outline-rect {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  padding: 16px 24px;
  font-size: 15px;
  width: 100%;
}
.btn-outline-rect:hover { background: var(--primary-light); }

.btn-google {
  background: #fff;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  height: 52px;
  font-size: 16px;
  font-weight: 500;
  width: 100%;
}
.btn-google:hover { background: #f9f9f9; }

.btn-whatsapp {
  background: #25D366;
  color: #fff;
  border-radius: 12px;
  height: 52px;
  font-size: 16px;
  width: 100%;
}
.btn-whatsapp:hover { background: #20BD5A; }

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.btn-copy:hover { background: #f9f9f9; }

/* ——— Inputs ——— */
.input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  color: var(--text-primary);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--text-muted); }
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 122, 107, 0.12);
}

.input-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ——— Cards ——— */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
}
.card-lg {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px;
  box-shadow: 0 4px 24px rgba(26, 25, 24, 0.063);
}

/* ——— Address Card (forwarding addresses) ——— */
.address-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--primary-light);
  border: 1px solid #C8DDD8;
  border-radius: 12px;
  padding: 20px;
}
.address-card .address-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--primary);
}
.address-card .address-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.address-card .address-value span {
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-all;
}
.address-card .address-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* ——— Member Row ——— */
.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.member-row + .member-row { border-top: 1px solid var(--border); }
.member-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.member-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.member-email { font-size: 15px; color: var(--text-primary); }
.member-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.role-badge {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}
.role-badge.owner { color: var(--primary); }
.role-badge.member { color: var(--text-muted); }
.role-badge.pending { color: var(--cta); }
.btn-action {
  font-size: 13px;
  font-weight: 500;
  color: var(--cta);
  background: none;
  border: none;
  cursor: pointer;
}
.btn-action:hover { text-decoration: underline; }

/* ——— Divider ——— */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.divider span {
  font-size: 13px;
  color: var(--text-muted);
}

/* ——— Error/Success ——— */
.error-text {
  color: #dc2626;
  font-size: 14px;
  margin-top: 8px;
}
.success-text {
  color: #059669;
  font-size: 14px;
  margin-top: 8px;
}

/* ——— Spinner ——— */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
.spinner-dark {
  border-color: var(--primary);
  border-top-color: transparent;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ——— Toast ——— */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark-section);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 1000;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════════
   LAYOUT: Public Header (landing page)
   ════════════════════════════════════════ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  padding: 0 80px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
}
.site-header .logo svg { color: var(--primary); }
.site-header nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.site-header nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.site-header nav a:hover { color: var(--text-primary); }
.site-header .header-cta {
  background: var(--cta);
  color: #fff;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  text-decoration: none;
  transition: background 0.15s;
}
.site-header .header-cta:hover { background: var(--cta-hover); }

/* ════════════════════════════════════════
   LAYOUT: Footer
   ════════════════════════════════════════ */
.site-footer {
  background: var(--dark-section);
  padding: 60px 80px 40px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 320px;
}
.footer-brand .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.footer-brand .logo svg { color: #fff; }
.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 80px;
}
.footer-links-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer-links-col span {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.footer-links-col a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.footer-links-col a:hover { color: #fff; }
.footer-divider {
  height: 1px;
  background: #2A3B42;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #6B7B82;
}

/* ════════════════════════════════════════
   LAYOUT: Signup Shell (centered card)
   ════════════════════════════════════════ */
.signup-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: var(--page-bg);
  padding: 24px;
}
.signup-shell .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
}
.signup-shell .logo svg { color: var(--primary); }
.signup-shell .tagline {
  font-size: 13px;
  color: var(--text-muted);
}
.signup-card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 48px;
  box-shadow: 0 4px 24px rgba(26, 25, 24, 0.063);
}
.signup-card h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-align: center;
}
.signup-card .lead {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  max-width: 340px;
}

/* ════════════════════════════════════════
   LAYOUT: Dashboard (sidebar + content)
   ════════════════════════════════════════ */
.dash-layout {
  display: flex;
  height: 100vh;
  width: 100%;
  flex-direction: column;
  background: var(--page-bg);
}

/* Dashboard Header */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dash-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
}
.dash-header .logo svg { color: var(--primary); }
.dash-header-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

/* Dashboard Body (sidebar + main) */
.dash-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.dash-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding-top: 24px;
}
.dash-sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px 0;
}
.dash-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s;
}
.dash-sidebar-link:hover { background: rgba(0,0,0,0.03); }
.dash-sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.dash-sidebar-link.active svg { color: var(--primary); }
.dash-sidebar-link svg { color: var(--text-secondary); }
.dash-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
}
.dash-sidebar-user .member-avatar {
  width: 32px; height: 32px; font-size: 11px;
}
.dash-sidebar-user span {
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dashboard Main Content */
.dash-main {
  flex: 1;
  overflow-y: auto;
  padding: 48px 80px;
}
.dash-main h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 40px;
}

/* ——— Stat Card ——— */
.stat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.stat-card .stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
}
.stat-card .stat-label {
  font-size: 14px;
  color: var(--text-muted);
}

/* ——— Share Box (link/code) ——— */
.share-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 20px;
}
.share-box .share-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}
.share-box .share-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.share-box .share-value span {
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ——— Reminder Banner ——— */
.reminder-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-light);
  border-radius: 12px;
  padding: 20px 24px;
}
.reminder-banner svg { color: var(--primary); flex-shrink: 0; }
.reminder-banner .reminder-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.reminder-banner .reminder-sub {
  font-size: 14px;
  color: var(--text-muted);
  word-break: break-all;
}

/* ——— Invite Banner (household/class invite pages) ——— */
.invite-banner {
  background: var(--primary-light);
  border: 1px solid #C8DDD8;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  width: 100%;
  max-width: 440px;
}
.invite-banner .invite-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}
.invite-banner .invite-child {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ——— Success Check ——— */
.success-check {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-check svg { color: var(--primary); }

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */
@media (max-width: 1024px) {
  .site-header { padding: 0 24px; }
  .site-header nav { gap: 20px; }
  .dash-main { padding: 32px 24px; }
  .site-footer { padding: 40px 24px 32px; }
}

@media (max-width: 768px) {
  /* Landing sections — layout handled in index.html inline styles */
  .hero-grid { flex-direction: column; gap: 40px; }
  .hero-text { width: 100%; }
  .hero-mockups { display: none; }

  .site-header nav a:not(.header-cta):not(#nav-account) { display: none; }

  /* Dashboard: hide sidebar, show hamburger */
  .dash-sidebar { display: none; }
  .dash-sidebar.open { display: flex; position: fixed; top: 64px; left: 0; bottom: 0; z-index: 900; width: 260px; }
  .dash-main { padding: 24px 16px; }
  .dash-main h1 { font-size: 24px; }

  /* Stack address cards, share boxes, stat cards vertically */
  .address-card { flex: none; }
  .share-box { flex: none; }
  .stat-card { flex: none; }

  .signup-card { padding: 32px 24px; }
  .card-lg { padding: 32px 24px; }
  .card { padding: 24px 16px; }

  .footer-top { flex-direction: column; gap: 32px; }
  .footer-links { gap: 40px; }
}

@media (max-width: 480px) {
  .site-header .header-cta { padding: 10px 20px; font-size: 14px; }
}

/* ——— Step visibility ——— */
.step { display: none; }
.step.active { display: block; }
.view { display: none; }
.view.active { display: flex; flex-direction: column; }
