/* ============================================================
   RankLens — auth + dashboard styles
   Palette: pine ink / sage canvas / viridian signal
   ============================================================ */

:root {
  --ink:        #16211f;
  --ink-soft:   #24322f;
  --ink-line:   rgba(255, 255, 255, 0.14);
  --canvas:     #f1f4f1;
  --surface:    #ffffff;
  --accent:     #1d6b54;
  --accent-deep:#14503f;
  --accent-wash:#e2efe9;
  --text:       #1b2523;
  --muted:      #67766f;
  --line:       #dce3de;
  --danger:     #a1362b;
  --danger-wash:#fbeceb;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --font-display: 'Bricolage Grotesque', Georgia, serif;
  --font-ui: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ------------------------------------------------------------
   Split shell
   ------------------------------------------------------------ */

.shell {
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  min-height: 100vh;
}

/* ---- Left: brand panel ---- */

.brand-panel {
  position: relative;
  background: var(--ink);
  color: #eef2ef;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
}

.brand-mark span.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6fd3ab;
  display: inline-block;
}

.brand-body { max-width: 30ch; }

.brand-body h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  color: #fff;
}

.brand-body p {
  margin: 0;
  color: #a9b8b2;
  font-size: 15px;
  max-width: 34ch;
}

/* The one bold element: a rank-position chart drawn in SVG */
.rank-figure {
  margin: 36px 0 30px;
  border-top: 1px solid var(--ink-line);
  border-bottom: 1px solid var(--ink-line);
  padding: 22px 0;
}

.rank-figure svg { width: 100%; height: auto; display: block; }

.rank-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  font-size: 12.5px;
  color: #8b9a94;
}

.rank-caption b {
  display: block;
  color: #fff;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-foot { font-size: 13px; color: #7d8c86; }

/* ---- Right: form panel ---- */

.form-panel {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.form-wrap { width: 100%; max-width: 400px; }

.form-wrap > header { margin-bottom: 26px; }

.form-wrap h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 27px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.form-wrap header p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ------------------------------------------------------------
   Fields
   ------------------------------------------------------------ */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.field .optional { color: var(--muted); font-weight: 400; }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .12s ease, background .12s ease;
}

.field input:hover { border-color: #c4cec8; }

.field input:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fffbfb;
}

.field .hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.field .error { display: block; margin-top: 6px; font-size: 12.5px; color: var(--danger); }

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 18px 0;
  font-size: 13.5px;
  color: var(--muted);
}

.field-check input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 18px;
  font-size: 13.5px;
}

.field-row label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.field-row input { accent-color: var(--accent); }

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background .12s ease, border-color .12s ease;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }

.btn-google {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}
.btn-google:hover { background: #f7f9f8; border-color: #c4cec8; }
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ------------------------------------------------------------
   Divider
   ------------------------------------------------------------ */

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ------------------------------------------------------------
   Alerts
   ------------------------------------------------------------ */

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid;
}

.alert-error   { background: var(--danger-wash); border-color: #eecac6; color: var(--danger); }
.alert-success { background: var(--accent-wash); border-color: #bcdccf; color: var(--accent-deep); }

.form-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------------------------------------
   Dashboard
   ------------------------------------------------------------ */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar .brand-mark { color: var(--text); }
.topbar .brand-mark span.dot { background: var(--accent); }

.account { display: flex; align-items: center; gap: 12px; font-size: 14px; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent-deep);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  object-fit: cover;
}

.page { max-width: 960px; margin: 0 auto; padding: 40px 24px 72px; }

.page h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.page > p.lede { margin: 0 0 32px; color: var(--muted); max-width: 62ch; }

.next-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 22px;
}

.next-step h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.next-step p { margin: 0 0 18px; color: var(--muted); max-width: 58ch; font-size: 14.5px; }
.next-step .btn { width: auto; display: inline-flex; }

.detail-list {
  margin: 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; text-align: right; }

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.template-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: #fafbfa;
}

.template-item h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.template-item p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; min-height: auto; }

  .brand-panel {
    padding: 22px 24px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .brand-body, .rank-figure, .brand-foot { display: none; }

  .form-panel { padding: 36px 24px 56px; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
