/* Chores → Payday - Complete Design System */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Quicksand:wght@500;600;700&display=swap');

:root {
  --primary: #5D4EE8; --primary-light: #7B6FF0; --primary-dark: #4338CA;
  --gold: #F59E0B; --gold-light: #FBBF24; --gold-dark: #D97706;
  --success: #10B981; --success-light: #34D399; --success-bg: #ECFDF5;
  --warning: #F59E0B; --warning-bg: #FFFBEB;
  --danger: #EF4444; --danger-light: #FCA5A5; --danger-bg: #FEF2F2;
  --text-primary: #1F2937; --text-secondary: #6B7280; --text-muted: #9CA3AF;
  --bg-page: #F8FAFC; --bg-card: #FFFFFF; --bg-subtle: #F1F5F9;
  --border: #E2E8F0; --border-light: #F1F5F9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04); --shadow-md: 0 4px 12px rgba(0,0,0,0.06); --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px; --radius-full: 9999px;
  --transition-fast: 150ms ease; --transition-base: 250ms ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body { font-family: 'Nunito', sans-serif; font-size: 16px; line-height: 1.6; color: var(--text-primary); background: var(--bg-page); min-height: 100vh; }

.wrap { max-width: 900px; margin: 0 auto; padding: 24px 20px 48px; }
.wrap-narrow { max-width: 440px; margin: 0 auto; padding: 24px 20px 48px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.header { display: flex; align-items: center; gap: 12px; }
.header-icon { width: 48px; height: 48px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: var(--shadow-md); }
.header-text h1 { font-family: 'Quicksand', sans-serif; font-size: 28px; font-weight: 700; line-height: 1.2; }
.header-text .subtitle { font-size: 14px; color: var(--text-secondary); font-weight: 500; }

h1 { font-family: 'Quicksand', sans-serif; font-size: 32px; font-weight: 700; line-height: 1.2; }
h2 { font-family: 'Quicksand', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 16px; }
h3 { font-size: 16px; font-weight: 700; }
p { color: var(--text-secondary); line-height: 1.6; }
.muted { color: var(--text-muted); font-size: 14px; }
.text-success { color: var(--success); } .text-warning { color: var(--warning); } .text-danger { color: var(--danger); } .text-primary { color: var(--primary); }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); transition: box-shadow var(--transition-base); }
.card:hover { box-shadow: var(--shadow-md); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-header h2 { margin-bottom: 0; display: flex; align-items: center; gap: 10px; }
.card-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.card-icon.purple { background: #EDE9FE; } .card-icon.gold { background: #FEF3C7; } .card-icon.green { background: #D1FAE5; } .card-icon.blue { background: #DBEAFE; } .card-icon.pink { background: #FCE7F3; }

.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 40px; box-shadow: var(--shadow-lg); margin-top: 40px; }
.auth-card h1 { text-align: center; margin-bottom: 8px; }
.auth-card .subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 32px; }
.auth-icon { width: 80px; height: 80px; margin: 0 auto 24px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 40px; box-shadow: var(--shadow-md); }
.auth-footer { text-align: center; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 700; border-radius: var(--radius-md); border: none; cursor: pointer; transition: all var(--transition-fast); text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; box-shadow: 0 2px 8px rgba(93,78,232,0.25); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(93,78,232,0.35); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-subtle); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--border-light); }
.btn-success { background: linear-gradient(135deg, var(--success), var(--success-light)); color: white; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: white; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-light); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: white; }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 8px 12px; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-subtle); color: var(--text-primary); }
.btn-sm { padding: 8px 14px; font-size: 13px; } .btn-lg { padding: 16px 28px; font-size: 17px; border-radius: var(--radius-lg); } .btn-block { width: 100%; }

.input { width: 100%; padding: 14px 16px; font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 500; color: var(--text-primary); background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius-md); transition: all var(--transition-fast); outline: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(93,78,232,0.1); }
.input::placeholder { color: var(--text-muted); font-weight: 500; }
.input.error { border-color: var(--danger); }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.input-group .hint { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.input-group .error-text { font-size: 13px; color: var(--danger); margin-top: 6px; }
.code-input { font-family: 'SF Mono', monospace; font-size: 24px; font-weight: 700; text-align: center; letter-spacing: 4px; text-transform: uppercase; padding: 20px; }
.pin-input { font-family: 'SF Mono', monospace; font-size: 28px; font-weight: 700; text-align: center; letter-spacing: 12px; padding: 20px; }

.form-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.form-row:last-child { margin-bottom: 0; }
.checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; color: var(--text-secondary); padding: 10px 14px; background: var(--bg-subtle); border-radius: var(--radius-md); }
.checkbox-label input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; font-size: 12px; font-weight: 700; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.5px; }
.badge-success { background: var(--success-bg); color: var(--success); } .badge-warning { background: var(--warning-bg); color: var(--gold-dark); } .badge-danger { background: var(--danger-bg); color: var(--danger); } .badge-primary { background: #EDE9FE; color: var(--primary); } .badge-neutral { background: var(--bg-subtle); color: var(--text-secondary); }
.points { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: var(--gold-dark); font-size: 13px; font-weight: 800; border-radius: var(--radius-full); }
.points::before { content: "⭐"; font-size: 11px; }

.list { display: flex; flex-direction: column; gap: 12px; }
.item { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); transition: all var(--transition-fast); }
.item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.item-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.item-content { flex: 1; min-width: 0; }
.item-title { font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.item-meta { font-size: 13px; color: var(--text-muted); }
.item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.chore-item { position: relative; }
.chore-item.completed { background: var(--success-bg); border-color: var(--success); }
.chore-item.completed .item-title { text-decoration: line-through; color: var(--success); }
.chore-item.required::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--danger); border-radius: var(--radius-md) 0 0 var(--radius-md); }
.child-item .item-icon { background: linear-gradient(135deg, #A78BFA, #C4B5FD); color: white; font-weight: 800; }
.approval-item { border: 2px solid var(--warning); }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { text-align: center; padding: 20px 16px; background: var(--bg-subtle); border-radius: var(--radius-md); }
.stat-value { font-family: 'Quicksand', sans-serif; font-size: 32px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card.gold { background: linear-gradient(135deg, #FEF3C7, #FDE68A); }
.stat-card.gold .stat-value { color: var(--gold-dark); }

.payday-banner { background: linear-gradient(135deg, #FEF3C7, #FDE68A, #FCD34D); border-radius: var(--radius-lg); padding: 24px; text-align: center; margin-bottom: 24px; border: 2px solid var(--gold); position: relative; overflow: hidden; }
.payday-banner::before { content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%); animation: shimmer 3s infinite; }
@keyframes shimmer { 0% { transform: translateX(-100%) rotate(45deg); } 100% { transform: translateX(100%) rotate(45deg); } }
.payday-banner h3 { font-family: 'Quicksand', sans-serif; font-size: 16px; font-weight: 700; color: var(--gold-dark); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; position: relative; }
.payday-countdown { font-family: 'Quicksand', sans-serif; font-size: 36px; font-weight: 800; color: var(--text-primary); position: relative; }

.notification { display: flex; align-items: flex-start; gap: 14px; padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 12px; }
.notification-icon { width: 36px; height: 36px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.notification.success .notification-icon { background: var(--success-bg); }
.notification.warning .notification-icon { background: var(--warning-bg); }
.notification-content { flex: 1; }
.notification-message { font-weight: 600; margin-bottom: 4px; }
.notification-time { font-size: 12px; color: var(--text-muted); }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 18px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state-text { font-size: 14px; max-width: 280px; margin: 0 auto; }

.link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); text-decoration: none; font-weight: 600; font-size: 14px; }
.link:hover { color: var(--primary); }

.user-info { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.user-name { font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

.debug-panel { background: #1E1E2E; border-radius: var(--radius-md); padding: 16px; overflow: auto; }
.debug-panel pre { margin: 0; font-family: 'SF Mono', monospace; font-size: 13px; color: #A6E3A1; white-space: pre-wrap; min-height: 40px; }

.hero { text-align: center; padding: 60px 20px 40px; margin-bottom: 24px; }
.hero-icon { width: 100px; height: 100px; margin: 0 auto 24px; background: linear-gradient(135deg, var(--gold), var(--gold-light)); border-radius: var(--radius-xl); display: flex; align-items: center; justify-content: center; font-size: 48px; box-shadow: 0 8px 32px rgba(245,158,11,0.3); animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.hero h1 { font-size: 42px; margin-bottom: 16px; background: linear-gradient(135deg, var(--text-primary), var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 18px; color: var(--text-secondary); max-width: 440px; margin: 0 auto 32px; line-height: 1.6; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-bottom: 32px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; text-align: center; transition: all var(--transition-base); }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.feature-icon { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.feature-card h3 { margin-bottom: 8px; font-size: 17px; }
.feature-card p { font-size: 14px; line-height: 1.5; }

.alert { padding: 14px 18px; border-radius: var(--radius-md); margin-bottom: 20px; font-weight: 600; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-light); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-info { background: #EDE9FE; color: var(--primary); }

.child-code-display { font-family: 'SF Mono', monospace; font-size: 28px; font-weight: 700; letter-spacing: 4px; background: var(--bg-subtle); padding: 16px 24px; border-radius: var(--radius-md); text-align: center; color: var(--primary); }

@media (max-width: 600px) {
  .wrap, .wrap-narrow { padding: 16px 16px 32px; }
  .hero { padding: 40px 16px 32px; }
  .hero h1 { font-size: 32px; }
  .hero-icon { width: 80px; height: 80px; font-size: 36px; }
  .top { flex-direction: column; align-items: flex-start; }
  .card { padding: 20px; }
  .auth-card { padding: 24px; }
  .form-row { flex-direction: column; }
  .form-row .input, .form-row .btn { width: 100%; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .item { flex-wrap: wrap; }
  .item-actions { width: 100%; justify-content: flex-end; padding-top: 8px; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease forwards; }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
.pop { animation: pop 0.3s ease; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.mt-sm { margin-top: 8px; } .mt-md { margin-top: 16px; } .mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; } .mb-md { margin-bottom: 16px; } .mb-lg { margin-bottom: 24px; }
.text-center { text-align: center; }
.hidden { display: none !important; }
