/* Amadeus Life Board — Companion UI v3 */
:root {
  --green: #58cc02;
  --green-dark: #46a302;
  --blue: #1cb0f6;
  --blue-dark: #0a90d4;
  --purple: #a560e8;
  --purple-dark: #8a4fd0;
  --orange: #ff9600;
  --red: #ff4b4b;
  --yellow: #ffc800;
  --teal: #00b3a4;
  --pink: #e91e63;
  --bg: #f7f7f7;
  --card: #ffffff;
  --text: #3c3c3c;
  --text-light: #777777;
  --border: #e5e5e5;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Nunito', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; }

/* Login */
.login-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-logo { font-size: 64px; margin-bottom: 8px; }
.login-title { font-size: 28px; font-weight: 900; margin-bottom: 4px; }
.login-subtitle { font-size: 16px; color: var(--text-light); margin-bottom: 32px; }
.login-card { background: var(--card); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 360px; box-shadow: var(--shadow); }
.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--text-light); }
.input-group input, .input-group textarea, .input-group select {
  width: 100%; padding: 14px 16px; border: 2px solid var(--border); border-radius: 12px; font-size: 16px; font-family: inherit; transition: border-color 0.2s;
}
.input-group input:focus, .input-group textarea:focus, .input-group select:focus { outline: none; border-color: var(--blue); }
.btn { width: 100%; padding: 16px; border: none; border-radius: 12px; font-size: 16px; font-weight: 800; font-family: inherit; cursor: pointer; transition: transform 0.1s, filter 0.2s; }
.btn:active { transform: translateY(2px); }
.btn-primary { background: var(--green); color: white; box-shadow: 0 4px 0 var(--green-dark); }
.btn-green { background: var(--teal); color: white; box-shadow: 0 4px 0 #00897b; }
.btn-blue { background: var(--blue); color: white; box-shadow: 0 4px 0 var(--blue-dark); }
.btn-outline { background: white; color: var(--blue); border: 2px solid var(--blue); }
.login-error { color: var(--red); font-size: 14px; margin-top: 12px; text-align: center; }

/* Header */
.header { background: var(--card); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.header-user { display: flex; align-items: center; gap: 8px; }
.header-avatar { font-size: 28px; }
.header-name { font-weight: 800; font-size: 16px; }
.header-sub { font-size: 12px; color: var(--text-light); }
.header-logout { background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px; }

/* Tabs */
.tabs { display: flex; background: var(--card); position: sticky; top: 60px; z-index: 99; border-bottom: 1px solid var(--border); }
.tab { flex: 1; padding: 14px 8px; text-align: center; font-weight: 800; font-size: 13px; cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.2s; }
.tab.active { border-bottom-color: var(--teal); color: var(--teal); }
.tab:hover { background: #f0f0f0; }

/* Dashboard */
.dashboard { padding: 16px; }

/* Conversation Cards */
.conv-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.conv-label { font-size: 14px; font-weight: 800; color: var(--text-light); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.conv-question { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.conv-hint { font-size: 13px; color: var(--text-light); margin-bottom: 12px; }
.conv-text { font-size: 16px; line-height: 1.5; margin-bottom: 8px; }
.conv-meta { font-size: 13px; color: var(--text-light); }
.conv-sugg-title { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.conv-done { color: var(--green-dark); font-weight: 800; padding: 8px 0; }

/* Intention */
.conv-intention { border-left: 4px solid var(--teal); }
.intention-row { margin-bottom: 8px; }
.intention-row select { padding: 10px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; width: 100%; }
textarea { width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; resize: vertical; min-height: 60px; margin-bottom: 12px; }
textarea:focus { outline: none; border-color: var(--blue); }

/* Suggestion */
.conv-suggestion { border-left: 4px solid var(--blue); }
.quest-video { width: 100%; aspect-ratio: 16/9; border-radius: 12px; border: none; margin-bottom: 12px; }

/* Alternatives */
.alt-suggestions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.alt-label { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.alt-item { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 10px; cursor: pointer; transition: background 0.2s; }
.alt-item:hover { background: #f0f0f0; }
.alt-emoji { font-size: 18px; }
.alt-text { flex: 1; font-size: 14px; }
.alt-dur { font-size: 12px; color: var(--text-light); }

/* Custom */
.conv-custom { border-left: 4px solid var(--purple); }
.custom-row { display: flex; gap: 8px; margin-bottom: 8px; }
.custom-row select { padding: 10px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.custom-row input { flex: 1; padding: 10px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.custom-row input:focus, .custom-row select:focus { outline: none; border-color: var(--purple); }

/* Reflection */
.conv-prompt { border-left: 4px solid var(--orange); }
.reflection-form label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 4px; color: var(--text-light); }
.mood-scale, .pain-scale { display: flex; gap: 8px; margin-bottom: 12px; }
.mood-btn, .pain-btn { flex: 1; padding: 10px; border: 2px solid var(--border); border-radius: 10px; background: white; font-size: 18px; cursor: pointer; font-family: inherit; transition: all 0.2s; }
.mood-btn.selected, .pain-btn.selected { border-color: var(--blue); background: #e3f2fd; }
.mood-btn:hover, .pain-btn:hover { border-color: var(--blue); }
.conv-reflection-done { border-left: 4px solid var(--purple); }

/* Log */
.conv-log { border-left: 4px solid var(--text-light); }
.log-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.log-row:last-child { border-bottom: none; }
.log-text { flex: 1; font-size: 14px; }
.log-date { font-size: 12px; color: var(--text-light); }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-title { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.empty { color: var(--text-light); font-size: 14px; padding: 8px 0; }

/* Week Stats */
.week-stats { display: flex; gap: 12px; }
.week-stat { flex: 1; text-align: center; }
.week-num { font-size: 32px; font-weight: 900; color: var(--teal); }
.week-label { font-size: 12px; color: var(--text-light); }

/* Pattern */
.pattern-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.pattern-stat { flex: 1; min-width: 80px; text-align: center; }
.pattern-num { font-size: 28px; font-weight: 900; }
.pattern-label { font-size: 11px; color: var(--text-light); }
.pattern-bars { display: flex; flex-direction: column; gap: 8px; }
.pattern-bar-row { display: flex; align-items: center; gap: 8px; }
.pattern-bar-emoji { font-size: 18px; width: 24px; }
.pattern-bar-name { font-size: 13px; width: 100px; }
.pattern-bar-bg { flex: 1; background: var(--border); border-radius: 8px; height: 12px; overflow: hidden; }
.pattern-bar-fill { height: 100%; border-radius: 8px; transition: width 0.5s; }
.pattern-bar-count { font-size: 13px; font-weight: 800; width: 24px; text-align: right; }
.insight-text { font-size: 14px; line-height: 1.5; color: var(--text); }

/* Reflection rows */
.refl-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.refl-row:last-child { border-bottom: none; }
.refl-date { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.refl-text { font-size: 13px; margin-bottom: 4px; }

/* Onboarding */
.onboarding { padding: 16px; }
.onboarding-title { font-size: 24px; font-weight: 900; text-align: center; margin-bottom: 8px; }
.onboarding-subtitle { font-size: 16px; color: var(--text-light); text-align: center; margin-bottom: 24px; }
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.category-card { background: var(--card); border-radius: 14px; padding: 16px; text-align: center; cursor: pointer; border: 3px solid transparent; transition: all 0.2s; box-shadow: var(--shadow); }
.category-card.selected { border-color: var(--teal); background: #e0f7f4; }
.category-card:hover { transform: translateY(-2px); }
.category-emoji { font-size: 36px; margin-bottom: 8px; }
.category-name { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.category-desc { font-size: 11px; color: var(--text-light); }

/* Profile */
.profile-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.profile-cat-tag { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; color: white; }
.goal-list { margin-top: 12px; }
.goal-item { background: #f7f7f7; border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.goal-item-emoji { font-size: 20px; }
.goal-item-text { flex: 1; font-size: 14px; }
.goal-item-cat { font-size: 11px; color: var(--text-light); }
.goal-input-row { display: flex; gap: 8px; margin-top: 12px; }
.goal-input-row select { padding: 10px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.goal-input-row input { flex: 1; padding: 10px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.goal-input-row input:focus, .goal-input-row select:focus { outline: none; border-color: var(--blue); }

@media (max-width: 360px) {
  .category-grid { grid-template-columns: 1fr; }
  .week-stats { flex-direction: column; }
  .pattern-stats { flex-direction: column; }
}