:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-input: #242833;
  --border: #2e3340;
  --text: #e8eaf0;
  --text-muted: #9ba3b5;
  --primary: #7c5cfc;
  --primary-hover: #6a4ae0;
  --accent: #00c9a7;
  --danger: #ff6b6b;
  --warning: #ffc107;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.hidden { display: none !important; }

/* AUTH */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at top, #1a1535 0%, var(--bg) 60%);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
}

.logo { text-align: center; margin-bottom: 28px; }
.logo-icon { font-size: 42px; color: var(--primary); }
.logo h1 { font-size: 26px; font-weight: 700; }
.subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  background: var(--bg-input);
  border-radius: 10px;
  padding: 4px;
}
.tab {
  flex: 1; padding: 10px; border: none; background: transparent;
  color: var(--text-muted); font-family: inherit; font-size: 14px;
  font-weight: 500; border-radius: 8px; cursor: pointer;
}
.tab.active { background: var(--primary); color: #fff; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-muted); margin-bottom: 6px;
}
input {
  width: 100%; padding: 12px 14px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: inherit; font-size: 15px;
}
input:focus { outline: none; border-color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px; border: none; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn.primary { background: var(--primary); color: #fff; width: 100%; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); padding: 8px 14px; font-size: 13px;
}
.btn.full { width: 100%; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; }

/* HEADER */
.app-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; background: var(--bg-card);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.logo-small { color: var(--primary); font-size: 20px; }
.header-right { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); }

.container { max-width: 920px; margin: 0 auto; padding: 24px 16px 60px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
}
.card h2 { font-size: 17px; margin-bottom: 6px; }
.hint { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* SUMMARY */
.summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-top: 12px;
}
.summary-item {
  background: var(--bg-input); border-radius: 12px; padding: 18px 14px; text-align: center;
}
.summary-item .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.summary-item .value { font-size: 32px; font-weight: 700; color: var(--primary); margin: 4px 0; }
.summary-item .sub { font-size: 12px; color: var(--accent); }

/* BIRTH CHART */
.birth-chart {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  max-width: 300px; margin: 16px auto;
}
.chart-cell {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 12px; border: 2px solid var(--border); background: var(--bg-input);
}
.chart-cell .num { font-size: 26px; font-weight: 700; }
.chart-cell .count { font-size: 11px; color: var(--text-muted); }
.chart-cell.present { border-color: var(--accent); background: rgba(0,201,167,0.08); }
.chart-cell.present .num { color: var(--accent); }
.chart-cell.missing { opacity: 0.5; }
.chart-cell.multi { border-color: var(--primary); background: rgba(124,92,252,0.12); }
.chart-cell.multi .num { color: var(--primary); }

.chart-legend {
  display: flex; justify-content: center; gap: 20px;
  margin-top: 12px; font-size: 12px; color: var(--text-muted);
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot.present { background: var(--accent); }
.dot.missing { background: var(--border); }
.dot.multi { background: var(--primary); }

/* ARROWS */
.arrows-list { display: flex; flex-direction: column; gap: 10px; }
.arrow-item {
  background: var(--bg-input); border-radius: 10px; padding: 14px 16px;
  border-left: 4px solid var(--primary);
}
.arrow-item.positive { border-left-color: var(--accent); }
.arrow-item.negative { border-left-color: var(--danger); }
.arrow-title { font-weight: 600; margin-bottom: 3px; font-size: 14px; }
.arrow-desc { font-size: 13px; color: var(--text-muted); }

/* CYCLE */
.cycle-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px; margin-top: 10px;
}
.cycle-item {
  background: var(--bg-input); border-radius: 10px; padding: 12px 6px;
  text-align: center; border: 1px solid transparent; cursor: pointer;
  transition: all 0.15s;
}
.cycle-item:hover { border-color: var(--primary); }
.cycle-item.current { border-color: var(--primary); background: rgba(124,92,252,0.18); }
.cycle-item .year { font-size: 11px; color: var(--text-muted); }
.cycle-item .num { font-size: 20px; font-weight: 700; color: var(--primary); }
.cycle-item .label { font-size: 10px; color: var(--text-muted); }

.year-detail {
  margin-top: 16px; background: var(--bg-input); border-radius: 12px; padding: 18px;
}
.year-detail h4 { margin-bottom: 8px; color: var(--primary); }
.year-detail ul { padding-left: 18px; font-size: 13px; color: var(--text-muted); }
.year-detail li { margin-bottom: 3px; }

/* PINNACLES */
.pinnacles-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-top: 10px;
}
.pinnacle-item { background: var(--bg-input); border-radius: 12px; padding: 16px; }
.pinnacle-item .p-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.pinnacle-item .p-num { font-size: 26px; font-weight: 700; color: var(--primary); margin: 4px 0; }
.pinnacle-item .p-age { font-size: 12px; color: var(--accent); }
.pinnacle-item .p-desc { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* NAME */
.name-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-top: 10px;
}
.name-item { background: var(--bg-input); border-radius: 12px; padding: 16px; text-align: center; }
.name-item .n-label { font-size: 12px; color: var(--text-muted); }
.name-item .n-num { font-size: 26px; font-weight: 700; color: var(--accent); margin-top: 4px; }

/* NOTES */
.notes-content { display: flex; flex-direction: column; gap: 16px; }
.note-block { background: var(--bg-input); border-radius: 12px; padding: 18px; }
.note-block h3 { font-size: 15px; margin-bottom: 10px; color: var(--primary); }
.note-block .pos-title { color: var(--accent); font-size: 13px; font-weight: 600; margin: 8px 0 4px; }
.note-block .neg-title { color: var(--danger); font-size: 13px; font-weight: 600; margin: 8px 0 4px; }
.note-block ul { padding-left: 18px; font-size: 13px; color: var(--text-muted); }
.note-block li { margin-bottom: 3px; }
.note-block .advice {
  margin-top: 10px; padding: 10px 12px; background: rgba(124,92,252,0.12);
  border-radius: 8px; font-size: 13px; border-left: 3px solid var(--primary);
}

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .summary-item .value { font-size: 26px; }
}
