/* ============================================================
   ConciergeFlow AI — brand.css
   A!thera Partners design tokens + base components.
   The single accent is A! Blue (#5FB8D6); blue is used sparingly.
   ============================================================ */

:root {
  /* Primary palette */
  --athera-blue: #5FB8D6;
  --athera-blue-light: #A8D9EC;
  --athera-blue-deep: #2A8FB0;
  --athera-charcoal: #374151;
  --athera-charcoal-light: #4B5563;
  --athera-grey: #6B7280;
  --athera-grey-light: #9CA3AF;
  --athera-navy: #0F172A;
  --athera-navy-mid: #1E2B42;

  /* Surfaces */
  --athera-white: #FFFFFF;
  --athera-off-white: #F8F7F4;
  --athera-surface: #F1EEE8;

  /* Extended palette */
  --athera-amber: #C8955A;
  --athera-amber-light: #E8C49A;
  --athera-steel: #8AA5BE;
  --athera-mist: #D4DFE8;

  /* Lines */
  --athera-line: rgba(55, 65, 81, 0.12);
  --athera-line-light: rgba(55, 65, 81, 0.06);
  --athera-line-dark: rgba(255, 255, 255, 0.08);
  --athera-line-dark-light: rgba(255, 255, 255, 0.06);

  /* Typography */
  --athera-display: 'Cormorant Garamond', Georgia, serif;
  --athera-sans: 'DM Sans', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --athera-mono: 'DM Mono', 'Consolas', 'Monaco', monospace;

  /* ---- Shared contract aliases (used across screens) ---- */
  --blue: var(--athera-blue);
  --blue-deep: var(--athera-blue-deep);
  --charcoal: var(--athera-charcoal);
  --charcoal-light: var(--athera-charcoal-light);
  --grey: var(--athera-grey);
  --grey-light: var(--athera-grey-light);
  --navy: var(--athera-navy);
  --offwhite: var(--athera-off-white);
  --surface: var(--athera-surface);
  --white: var(--athera-white);
  --line: var(--athera-line);
  --line-light: var(--athera-line-light);

  /* Spacing scale */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 48px;
  --sp-6: 64px;
  --sp-7: 80px;
  --sp-8: 120px;

  /* Radius + shadow + layout */
  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --maxw: 1180px;

  /* Sentiment colors */
  --sentiment-positive: #4E9A6B;
  --sentiment-neutral: var(--athera-grey);
  --sentiment-negative: var(--athera-amber);
}

/* ============================================================
   Global reset + base typography
   ============================================================ */

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

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

body {
  margin: 0;
  background: var(--offwhite);
  color: var(--charcoal);
  font-family: var(--athera-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--athera-display);
  font-weight: 300;
  color: var(--charcoal);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 var(--sp-2);
}

h1 { font-size: clamp(40px, 6vw, 64px); letter-spacing: -0.015em; }
h2 { font-size: clamp(28px, 4vw, 44px); }
h3 { font-size: clamp(22px, 3vw, 30px); font-weight: 400; }
h4 { font-size: 20px; font-weight: 400; }

p { margin: 0 0 var(--sp-2); }

a {
  color: var(--blue-deep);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--athera-blue); }

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--sp-4) 0;
}

::selection { background: var(--athera-blue-light); color: var(--charcoal); }

:focus-visible {
  outline: 2px solid var(--blue-deep);
  outline-offset: 2px;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: 12px 24px;
  font-family: var(--athera-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--charcoal);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--primary {
  background: var(--athera-blue);
  color: var(--athera-navy);
}
.btn--primary:hover:not(:disabled) { background: var(--blue-deep); color: #fff; }

.btn--ghost {
  background: transparent;
  color: var(--charcoal);
  border-color: var(--line);
}
.btn--ghost:hover:not(:disabled) { background: var(--white); border-color: var(--grey-light); }

.btn--subtle {
  background: var(--surface);
  color: var(--charcoal-light);
}
.btn--subtle:hover:not(:disabled) { background: var(--athera-mist); }

.btn--danger {
  background: transparent;
  color: var(--athera-amber);
  border-color: rgba(200, 149, 90, 0.4);
}
.btn--danger:hover:not(:disabled) { background: rgba(200, 149, 90, 0.08); }

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.card__head {
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--line-light);
}
.card__head h3, .card__head h4 { margin: 0; }

.card__body {
  padding: var(--sp-3);
}

/* ============================================================
   Labels, pills, badges
   ============================================================ */

.label {
  display: inline-block;
  font-family: var(--athera-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-family: var(--athera-sans);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--charcoal-light);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: var(--athera-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--grey);
  background: var(--white);
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge--high { color: var(--blue-deep); border-color: rgba(42, 143, 176, 0.3); background: rgba(95, 184, 214, 0.08); }
.badge--medium { color: var(--athera-amber); border-color: rgba(200, 149, 90, 0.3); background: rgba(200, 149, 90, 0.08); }
.badge--low { color: var(--grey); border-color: var(--line); background: var(--surface); }

/* ============================================================
   Meter (confidence / progress)
   ============================================================ */

.meter {
  width: 100%;
  height: 4px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}
.meter__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--athera-blue);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ============================================================
   Fields (input, select, textarea)
   ============================================================ */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
}

.field__label {
  font-family: var(--athera-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
}

.field input,
.field select,
.field textarea,
input.input,
select.select,
textarea.textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--athera-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--charcoal);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
}
.field textarea, textarea.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }

.field select,
select.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
input.input:focus,
select.select:focus,
textarea.textarea:focus {
  outline: none;
  border-color: var(--athera-blue);
  box-shadow: 0 0 0 3px rgba(95, 184, 214, 0.16);
}

.field input::placeholder,
.field textarea::placeholder { color: var(--grey-light); }

/* ============================================================
   Chips
   ============================================================ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: var(--athera-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--charcoal-light);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.chip:hover {
  border-color: var(--athera-blue);
  color: var(--charcoal);
}

/* ============================================================
   Toast
   ============================================================ */

#toast-root {
  position: fixed;
  right: var(--sp-3);
  bottom: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  z-index: 1000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 240px;
  max-width: 380px;
  padding: 14px 18px;
  font-family: var(--athera-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--charcoal);
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 2px solid var(--grey-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast--success { border-left-color: var(--sentiment-positive); }
.toast--error { border-left-color: var(--athera-amber); }
.toast--info { border-left-color: var(--athera-blue); }

/* ============================================================
   Spinner
   ============================================================ */

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--athera-blue);
  border-radius: 50%;
  animation: athera-spin 0.7s linear infinite;
}
@keyframes athera-spin { to { transform: rotate(360deg); } }

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