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

:root {
  --primary:   #6c63ff;
  --primary-d: #5a52e8;
  --bg:        #f5f4ff;
  --surface:   #ffffff;
  --text:      #1a1a2e;
  --text-sub:  #6b6b8a;
  --border:    #e4e2ff;
  --green:     #10b981;
  --red:       #ef4444;
  --amber:     #f59e0b;
  --radius:    16px;
  --shadow:    0 4px 24px rgba(108,99,255,.10);
}

body {
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Navbar ───────────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(108,99,255,.06);
}

.nav-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-links { display: flex; gap: 8px; }

.nav-link {
  text-decoration: none;
  color: var(--text-sub);
  font-size: .9rem;
  padding: 6px 16px;
  border-radius: 20px;
  transition: all .2s;
}
.nav-link:hover, .nav-link.active {
  background: var(--primary);
  color: #fff;
}

/* ── Main ─────────────────────────────────────────────── */
.main-content { max-width: 960px; margin: 0 auto; padding: 40px 24px 80px; }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}
.hero h1 { font-size: 2rem; font-weight: 800; }
.hero-sub { margin-top: 8px; color: var(--text-sub); line-height: 1.6; }

.recent-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.badge-label { display: block; font-size: .75rem; color: var(--text-sub); }
.badge-score { display: block; font-size: 2rem; font-weight: 800; color: var(--primary); }
.badge-date  { display: block; font-size: .75rem; color: var(--text-sub); }

/* ── Card Grid ────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(108,99,255,.18); }

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.card-mood::before     { background: linear-gradient(90deg, #6c63ff, #a78bfa); }
.card-thought::before  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.card-breathing::before{ background: linear-gradient(90deg, #10b981, #34d399); }

.card-icon { font-size: 2.4rem; margin-bottom: 12px; }
.card h2   { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.card p    { font-size: .85rem; color: var(--text-sub); line-height: 1.5; }
.card-stat { margin-top: 16px; font-size: .8rem; font-weight: 600; color: var(--primary); }
.card-arrow{ position: absolute; bottom: 20px; right: 20px; color: var(--primary); font-size: 1.2rem; }

/* ── Info Section ─────────────────────────────────────── */
.info-section {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 28px 32px;
}
.info-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 20px; color: var(--text-sub); }
.info-grid {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.info-item {
  background: var(--bg);
  border-radius: 12px;
  padding: 16px 20px;
  flex: 1;
  min-width: 140px;
}
.info-num   { display: block; font-size: .7rem; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.info-item strong { display: block; font-size: .9rem; margin-bottom: 4px; }
.info-item p { font-size: .8rem; color: var(--text-sub); }
.info-arrow { font-size: 1.2rem; color: var(--border); flex-shrink: 0; }

/* ── Page Header ──────────────────────────────────────── */
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 1.8rem; font-weight: 800; }
.page-header p  { color: var(--text-sub); margin-top: 6px; }

/* ── Panel ────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
.panel-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 20px; }
.panel-desc  { color: var(--text-sub); font-size: .9rem; line-height: 1.6; margin-bottom: 20px; }
.mt-24 { margin-top: 24px; }

/* ── Two Column ───────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Form ─────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 8px; }
.hint { font-weight: 400; color: var(--text-sub); font-size: .8rem; }

input[type="text"],
input[type="password"],
input[type="range"],
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .9rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus { border-color: var(--primary); }

input[type="range"] {
  padding: 0;
  height: 6px;
  cursor: pointer;
  accent-color: var(--primary);
}
textarea { resize: vertical; }

/* ── Score ────────────────────────────────────────────── */
.score-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-sub); margin-top: 6px; }
.score-badge  { background: var(--primary); color: #fff; border-radius: 20px; padding: 1px 10px; font-size: .85rem; font-weight: 700; }
.mood-big-emoji { font-size: 3.5rem; text-align: center; margin-top: 12px; }

/* ── Emotion Tags ─────────────────────────────────────── */
.emotion-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.emotion-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: .82rem;
  cursor: pointer;
  transition: all .15s;
  color: var(--text);
}
.emotion-tag:hover    { border-color: var(--primary); color: var(--primary); }
.emotion-tag.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary, .btn-secondary {
  border: none;
  border-radius: 10px;
  padding: 10px 24px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-d); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-large { padding: 14px 40px; font-size: 1rem; border-radius: 12px; }

.success-msg { color: var(--green); font-size: .85rem; margin-top: 10px; font-weight: 600; }
.hidden { display: none; }

/* ── Mood Entry ───────────────────────────────────────── */
.mood-entry {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.mood-entry:last-child { border-bottom: none; }
.mood-entry-left  { display: flex; align-items: flex-start; gap: 14px; }
.mood-entry-score {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800;
  flex-shrink: 0;
  background: var(--bg);
  color: var(--primary);
}
.mood-entry-date  { font-size: .78rem; color: var(--text-sub); }
.mood-entry-tags  { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mood-entry-note  { font-size: .82rem; color: var(--text-sub); margin-top: 4px; }
.mini-tag { background: var(--bg); border-radius: 20px; padding: 2px 8px; font-size: .75rem; color: var(--primary); }

.empty-state { text-align: center; padding: 32px; color: var(--text-sub); font-size: .9rem; line-height: 1.6; }

/* ── Steps ────────────────────────────────────────────── */
.steps-bar {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px 24px;
}
.step {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-sub);
  padding: 6px 14px;
  border-radius: 20px;
  transition: all .2s;
  white-space: nowrap;
}
.step.active { background: var(--primary); color: #fff; }
.step.done   { color: var(--primary); }
.step-line   { flex: 1; height: 2px; background: var(--border); margin: 0 4px; }

.step-panel { display: none; }
.step-panel.active { display: block; }

.step-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }

.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.label-red   { color: var(--red) !important; }
.label-green { color: var(--green) !important; }
.hint-text { font-size: .8rem; color: var(--text-sub); margin-top: 6px; }

/* ── Thought Entry ────────────────────────────────────── */
.thought-entry {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.thought-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.thought-date   { font-size: .78rem; color: var(--text-sub); }
.emotion-pill   { background: var(--bg); border-radius: 20px; padding: 3px 12px; font-size: .78rem; color: var(--primary); font-weight: 600; }

.thought-row { display: flex; gap: 12px; margin-bottom: 8px; font-size: .85rem; align-items: flex-start; }
.thought-label {
  flex-shrink: 0;
  width: 80px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-sub);
  padding-top: 1px;
}
.thought-label.alt { color: var(--green); }

/* ── Method Tabs ──────────────────────────────────────── */
.method-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.method-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 20px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  color: var(--text-sub);
}
.method-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.method-desc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: .88rem;
  color: var(--text-sub);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ── Breath Circle ────────────────────────────────────── */
.breath-center { display: flex; flex-direction: column; align-items: center; margin: 32px 0; }
.breath-ring-outer {
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(108,99,255,.06);
  display: flex; align-items: center; justify-content: center;
}
.breath-ring-inner {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(108,99,255,.15);
  border: 3px solid var(--primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform 1s ease, background-color 1s ease, border-color 1s ease;
}
.breath-text  { font-size: 1rem; font-weight: 700; color: var(--text); }
.breath-count { font-size: 2.2rem; font-weight: 800; color: var(--primary); min-height: 40px; }
.breath-phase { margin-top: 20px; font-size: 1rem; color: var(--text-sub); font-weight: 600; }

.breath-controls { display: flex; justify-content: center; gap: 12px; margin-bottom: 16px; }
.session-info    { text-align: center; font-size: .88rem; color: var(--primary); font-weight: 600; min-height: 24px; }

/* ── Method Cards ─────────────────────────────────────── */
.method-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 40px; }
.method-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}
.method-icon { font-size: 2rem; margin-bottom: 10px; }
.method-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: 8px; }
.method-card p  { font-size: .8rem; color: var(--text-sub); line-height: 1.6; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 700px) {
  .card-grid     { grid-template-columns: 1fr; }
  .two-col       { grid-template-columns: 1fr; }
  .info-grid     { flex-direction: column; }
  .evidence-grid { grid-template-columns: 1fr; }
  .method-cards  { grid-template-columns: 1fr; }
  .steps-bar     { flex-wrap: wrap; gap: 6px; }
  .hero          { flex-direction: column; gap: 16px; }
  .navbar        { padding: 0 16px; }
  .panel         { padding: 20px 18px; }
}

/* ── Login ────────────────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-container {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-logo  { font-size: 3rem; margin-bottom: 12px; }
.login-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.login-sub   { color: var(--text-sub); font-size: .88rem; margin-bottom: 32px; }

.login-form { text-align: left; }

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .85rem;
  margin-bottom: 16px;
  text-align: center;
}

.btn-full { width: 100%; margin-top: 8px; padding: 12px; font-size: .95rem; }

/* ── Nav User / Logout ────────────────────────────────── */
.nav-user   { font-size: .85rem; color: var(--text-sub); padding: 6px 8px; }
.nav-logout { color: var(--red) !important; }
.nav-logout:hover { background: #fef2f2 !important; color: var(--red) !important; }
