/* =========================================================
   GEO Data Collector — Phase I styles
   No framework. No build. Clean utility-adjacent CSS.
   ========================================================= */

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

:root {
  --bg:       #0f1117;
  --surface:  #1a1d27;
  --border:   #2d3148;
  --text:     #e8eaf0;
  --muted:    #8890b0;
  --accent:   #5b6ef5;
  --accent-h: #7b8ef8;

  --green:  #22c55e;
  --yellow: #eab308;
  --red:    #ef4444;

  --green-bg:  rgba(34,197,94,.12);
  --yellow-bg: rgba(234,179,8,.12);
  --red-bg:    rgba(239,68,68,.12);

  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}

html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ---- Layout ---- */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.topbar-logo { font-weight: 700; font-size: 1rem; letter-spacing: .5px; }
.topbar-client { color: var(--accent); font-size: .85rem; }
.topbar-spacer { flex: 1; }
.topbar-btn { display: flex; gap: .5rem; }

/* ---- Screens ---- */
.screen { display: none; }
.screen.active { display: block; }

/* ---- Auth screen ---- */
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 340px;
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-card h1 { font-size: 1.25rem; margin-bottom: .25rem; }
.auth-card p { color: var(--muted); font-size: .875rem; margin-bottom: 1.5rem; }

/* ---- Client init screen ---- */
.init-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.init-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 400px;
  box-shadow: var(--shadow);
}
.init-card h2 { font-size: 1.1rem; margin-bottom: .5rem; }
.init-card p  { color: var(--muted); font-size: .875rem; margin-bottom: 1.5rem; }

/* ---- Main form screen ---- */
.main-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: calc(100vh - 52px);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
}
.sidebar-section {
  display: flex; align-items: center; gap: .625rem;
  padding: .625rem 1rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
  font-size: .9rem;
}
.sidebar-section:hover { background: rgba(255,255,255,.04); }
.sidebar-section.active {
  border-left-color: var(--accent);
  background: rgba(91,110,245,.12);
}
.sidebar-section .badge {
  margin-left: auto;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge.green  { background: var(--green); }
.badge.yellow { background: var(--yellow); }
.badge.red    { background: var(--red); }
.badge.orange { background: #ffaa33; }
.badge.empty  { background: var(--border); }

.content {
  padding: 1.5rem 2rem 4rem;
  max-width: 860px;
  overflow-x: hidden;
}

/* ---- Section panels ---- */
.panel { display: none; }
.panel.active { display: block; }

.panel-header {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 1.1rem; font-weight: 600; }
.panel-badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  padding: .2rem .6rem; border-radius: 99px;
}
.panel-badge.green  { background: var(--green-bg);  color: var(--green);  }
.panel-badge.yellow { background: var(--yellow-bg); color: var(--yellow); }
.panel-badge.orange { background: rgba(255,165,0,.12); color: #ffaa33; }
.panel-badge.red    { background: var(--red-bg);    color: var(--red);    }
.panel-badge.empty  { background: rgba(255,255,255,.06); color: var(--muted); }
.dummy-badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  padding: .2rem .6rem; border-radius: 99px;
  background: rgba(255,165,0,.15); color: #ffaa33;
}

/* ---- Form elements ---- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .875rem 1.25rem;
}
.form-grid .full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: .35rem; }
.field label {
  font-size: .8rem; font-weight: 700; color: var(--accent-h);
  text-transform: uppercase; letter-spacing: .4px;
}
.field label .req { color: var(--red); margin-left: 2px; }
.field input,
.field textarea,
.field select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: .5rem .75rem;
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .15s;
  width: 100%;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: .75rem; color: var(--muted); }
.field .error-msg { font-size: .75rem; color: var(--red); display: none; }

/* Field state classes */
.field.is-valid input,  .field.is-valid textarea,  .field.is-valid select  { border-color: var(--green); }
.field.is-invalid input,.field.is-invalid textarea,.field.is-invalid select { border-color: var(--red); }
.field.is-invalid .error-msg { display: block; }
.field.is-missing input,.field.is-missing textarea,.field.is-missing select { border-color: var(--yellow); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

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

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: .4rem .75rem;
}
.btn-ghost:hover:not(:disabled) { color: var(--red); }

.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; }

/* ---- Repeatable items ---- */
.item-toolbar { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.item-list { display: flex; flex-direction: column; gap: 2rem; margin-bottom: 1rem; }

/* Sitemap / content status indicators */
#sitemap-content-status span:not(:empty)::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-right: .35rem;
  vertical-align: middle;
}

/* Separator between item cards */
.item-separator {
  height: 5px;
  background: rgba(255,255,255,0.35);
  width: calc(100% + 4rem);   /* bleed into content's left + right padding */
  margin: -0.5rem -2rem;
  border-radius: 2px;
}

.item-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.item-card-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1rem;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.item-card-header .item-title { font-size: .9rem; font-weight: 500; flex: 1; }
.item-card-header .item-badge { font-size: .7rem; padding: .15rem .5rem; border-radius: 99px; }
.item-card-body { padding: 1rem; }
.item-card-body.collapsed { display: none; }

/* ---- Action bar ---- */
.action-bar {
  position: fixed; bottom: 0; left: 220px; right: 0;
  display: flex; align-items: center; gap: .75rem;
  padding: .875rem 2rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 50;
}
.action-bar .status-msg { font-size: .85rem; color: var(--muted); flex: 1; }
.action-bar .status-msg.ok  { color: var(--green); }
.action-bar .status-msg.err { color: var(--red); }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 4.5rem; right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1.25rem;
  font-size: .875rem;
  box-shadow: var(--shadow);
  z-index: 200;
  max-width: 380px;
  animation: slide-in .2s ease;
  display: none;
}
.toast.show { display: block; }
.toast.ok  { border-color: var(--green); color: var(--green); }
.toast.err { border-color: var(--red);   color: var(--red);   }
@keyframes slide-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ---- Utility ---- */
.mt1 { margin-top: .5rem; }
.mt2 { margin-top: 1rem; }
.mt3 { margin-top: 1.5rem; }
.hidden { display: none !important; }

/* Divider between items in tag-style list */
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.tag {
  display: inline-flex; align-items: center; gap: .25rem;
  background: rgba(91,110,245,.15); color: var(--accent);
  padding: .2rem .55rem; border-radius: 99px; font-size: .78rem;
}
.tag button { background: none; border: none; cursor: pointer; color: inherit; padding: 0; line-height: 1; font-size: 1rem; }

/* Social profiles table */
.kv-table { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.kv-row { display: flex; gap: .5rem; align-items: center; }
.kv-row input { flex: 1; }

/* Pain points list */
.pain-list { display: flex; flex-direction: column; gap: .4rem; margin-top: .5rem; }
.pain-row  { display: flex; gap: .5rem; align-items: center; }
.pain-row input { flex: 1; }

/* ---- Utility zone (admin-only, low-profile) ---- */
.utility-zone {
  margin-top: 2rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  opacity: 0.35;
  transition: opacity .2s;
}
.utility-zone:hover { opacity: 1; }

/* Sentinel field — LLM attempted fill but had no result */
.field.needs-fill input,
.field.needs-fill textarea { border-color: var(--yellow) !important; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
