/* ============================================================================
   components.css — buttons, cards, tables, form controls, badges, alerts,
   plus the screen-specific blocks (hero, how-it-works, data cards, progress).
   ========================================================================== */

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

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px; border-radius: var(--radius-sm);
  font-family: var(--athera-sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; border: 1px solid transparent;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

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

.btn-secondary { background: transparent; color: var(--athera-charcoal); border-color: var(--athera-line-strong); font-weight: 400; }
.btn-secondary:hover:not(:disabled) { background: var(--athera-white); border-color: var(--athera-charcoal-light); }

.btn-ghost { background: transparent; color: var(--athera-blue-deep); border-color: transparent; padding-left: 0; padding-right: 0; }
.btn-ghost:hover:not(:disabled) { color: var(--athera-navy); }

.btn-sm { padding: 9px 16px; font-size: 11px; }

.btn .arrow { font-family: var(--athera-mono); font-weight: 400; }

/* ---- Cards --------------------------------------------------------------- */

.card {
  background: var(--athera-white);
  border: 1px solid var(--athera-line);
  border-radius: var(--radius);
  padding: var(--s-4);
}
.card-dark {
  background: var(--athera-navy);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--athera-line-dark);
  border-radius: var(--radius);
  padding: var(--s-4);
}

/* ---- Badges -------------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--athera-line);
  color: var(--athera-grey); background: var(--athera-off-white);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active { color: var(--athera-blue-deep); border-color: rgba(42, 143, 176, 0.3); background: rgba(95, 184, 214, 0.08); }
.badge-uploaded { color: var(--athera-amber); border-color: rgba(200, 149, 90, 0.35); background: rgba(200, 149, 90, 0.08); }
.badge-quiet { color: var(--athera-grey-light); }

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

.alert {
  border: 1px solid var(--athera-line);
  border-left: 2px solid var(--athera-grey-light);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  background: var(--athera-white);
  font-size: 13px; line-height: 1.6; color: var(--athera-charcoal-light);
}
.alert .alert-title { font-weight: 500; color: var(--athera-charcoal); margin-bottom: 4px; }
.alert-ok { border-left-color: var(--athera-blue-deep); }
.alert-warn { border-left-color: var(--athera-amber); }
.alert-error { border-left-color: var(--athera-amber); background: rgba(200, 149, 90, 0.05); }

/* ---- Tables -------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  padding: 12px 16px; text-align: left;
  font-size: 10px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--athera-grey-light); border-bottom: 1px solid var(--athera-line);
}
.table td { padding: 12px 16px; color: var(--athera-charcoal); border-bottom: 1px solid var(--athera-line-light); }
.table tr:last-child td { border-bottom: none; }
.table .mono { font-family: var(--athera-mono); font-size: 12px; color: var(--athera-grey); }

/* ---- Form controls ------------------------------------------------------- */

.field { margin-bottom: var(--s-5); }
.field-label { display: block; margin-bottom: 10px; }
.field-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--athera-grey); }
/* space the controls from the label/hint head and from each other */
.field > * + * { margin-top: 14px; }

.control-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Selectable pill (used for horizon, multi-select region/channel, level) */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--athera-line-strong);
  background: var(--athera-white); color: var(--athera-charcoal-light);
  font-size: 13px; cursor: pointer; -webkit-user-select: none; user-select: none;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.pill:hover { border-color: var(--athera-charcoal-light); }
.pill .pill-sub { font-family: var(--athera-mono); font-size: 11px; color: var(--athera-grey-light); }
.pill.is-selected {
  border-color: var(--athera-blue-deep);
  background: rgba(95, 184, 214, 0.08);
  color: var(--athera-charcoal);
}
.pill.is-selected .pill-sub { color: var(--athera-blue-deep); }
.pill[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }

/* Radio list (business objective) */
.radio-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--athera-line-strong);
  border-radius: var(--radius-sm); cursor: pointer; background: var(--athera-white);
  transition: border-color var(--ease), background var(--ease);
}
.radio-item:hover { border-color: var(--athera-charcoal-light); }
.radio-item.is-selected { border-color: var(--athera-blue-deep); background: rgba(95, 184, 214, 0.06); }
.radio-item .marker {
  flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--athera-grey-light); margin-top: 2px; position: relative;
}
.radio-item.is-selected .marker { border-color: var(--athera-blue-deep); }
.radio-item.is-selected .marker::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--athera-blue-deep);
}
.radio-item .marker-label { font-size: 14px; color: var(--athera-charcoal); }

/* Toggle switch */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px 20px; border: 1px solid var(--athera-line); border-radius: var(--radius); background: var(--athera-white); }
.toggle { position: relative; width: 44px; height: 24px; flex: 0 0 auto; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--athera-mist); transition: background var(--ease);
}
.toggle .thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--athera-white); transition: transform var(--ease);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}
.toggle input:checked + .track { background: var(--athera-blue-deep); }
.toggle input:checked ~ .thumb { transform: translateX(20px); }

/* SKU checklist */
.sku-group { margin-bottom: var(--s-3); }
.sku-group .group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--athera-line);
}
.sku-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.check {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--athera-line); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--athera-charcoal-light);
  transition: border-color var(--ease), background var(--ease);
}
.check:hover { border-color: var(--athera-charcoal-light); }
.check.is-selected { border-color: var(--athera-blue-deep); background: rgba(95, 184, 214, 0.05); color: var(--athera-charcoal); }
.check .box {
  flex: 0 0 auto; width: 15px; height: 15px; border-radius: 2px;
  border: 1px solid var(--athera-grey-light); position: relative;
}
.check.is-selected .box { border-color: var(--athera-blue-deep); background: var(--athera-blue-deep); }
.check.is-selected .box::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.check .new-tag { font-family: var(--athera-mono); font-size: 10px; color: var(--athera-amber); letter-spacing: 0.04em; }

/* Form footer (sticky action bar) */
.form-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3); margin-top: var(--s-6);
  padding-top: var(--s-4); border-top: 1px solid var(--athera-line);
}
.form-actions .summary-line { font-size: 13px; color: var(--athera-grey); }

/* Hidden native file input */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ============================================================================
   Screen: Home
   ========================================================================== */

.hero {
  background: var(--athera-navy);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-inner { max-width: var(--page-max); margin: 0 auto; padding: var(--s-8) var(--page-pad); position: relative; z-index: 1; }
.hero .eyebrow { color: rgba(255, 255, 255, 0.45); margin-bottom: 28px; }
.hero h1 { margin: 0; color: #fff; max-width: 14ch; }
.hero .lede { max-width: 600px; margin-top: 30px; color: rgba(255, 255, 255, 0.78); font-weight: 300; }
.hero .blue-rule { margin: 36px 0; }
.hero .hero-cta { margin-top: 40px; display: flex; align-items: center; gap: 20px; }
.hero .hero-meta { font-family: var(--athera-mono); font-size: 11px; color: rgba(255, 255, 255, 0.4); }

/* Concentric-circle motif, very subtle */
.hero .motif {
  position: absolute; right: -120px; top: 50%; transform: translateY(-50%);
  width: 640px; height: 640px; z-index: 0; pointer-events: none;
}
.hero .motif span {
  position: absolute; inset: 0; margin: auto; border-radius: 50%;
  border: 1px solid rgba(95, 184, 214, 0.10);
}

.how { max-width: var(--page-max); margin: 0 auto; padding: var(--s-7) var(--page-pad); }
.how .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); margin-top: var(--s-5); }
.how .step-card { padding-top: 22px; border-top: 1px solid var(--athera-line); }
.how .step-card .num { font-family: var(--athera-mono); font-size: 12px; color: var(--athera-blue-deep); }
.how .step-card h3 { font-family: var(--athera-display); font-weight: 400; font-size: 24px; margin: 14px 0 10px; color: var(--athera-charcoal); }
.how .step-card p { margin: 0; font-size: 14px; color: var(--athera-grey); line-height: 1.65; }

/* ============================================================================
   Screen: Data Library
   ========================================================================== */

.data-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); margin-top: var(--s-5); }
.data-card { display: flex; flex-direction: column; gap: 16px; }
.data-card .dc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.data-card .dc-title { font-family: var(--athera-display); font-size: 23px; font-weight: 400; color: var(--athera-charcoal); margin: 0; }
.data-card .dc-file { font-family: var(--athera-mono); font-size: 11px; color: var(--athera-grey-light); margin-top: 4px; }
.data-card .dc-stats { display: flex; gap: var(--s-4); padding: 4px 0; }
.data-card .dc-stat .k { display: block; font-size: 11px; }
.data-card .dc-stat .v { font-family: var(--athera-mono); font-size: 15px; color: var(--athera-charcoal); margin-top: 4px; }
.data-card .dc-actions { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 16px; }
.data-card .dc-validation { margin-top: 4px; }

.upload-meta { font-size: 12px; color: var(--athera-grey); margin-top: 10px; }
.rejection-list { margin: 10px 0 0; padding: 0; list-style: none; }
.rejection-list li { font-family: var(--athera-mono); font-size: 11px; color: var(--athera-charcoal-light); padding: 3px 0; line-height: 1.5; }
.rejection-list li .rownum { color: var(--athera-amber); }

/* ============================================================================
   Progress overlay
   ========================================================================== */

.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: var(--athera-navy); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 36px; animation: athera-fade 0.3s ease both;
}
.overlay .o-emblem { font-family: var(--athera-display); font-weight: 300; font-size: 40px; line-height: 1; letter-spacing: -0.01em; }
.overlay .o-steps { display: flex; flex-direction: column; gap: 14px; min-width: 280px; }
.overlay .o-step {
  display: flex; align-items: center; gap: 14px;
  font-size: 15px; color: rgba(255, 255, 255, 0.32);
  transition: color 0.4s ease;
}
.overlay .o-step .marker {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.2);
  transition: background 0.4s ease; flex: 0 0 auto;
}
.overlay .o-step.is-active { color: #fff; }
.overlay .o-step.is-active .marker { background: var(--athera-blue); }
.overlay .o-step.is-done { color: rgba(255, 255, 255, 0.6); }
.overlay .o-step.is-done .marker { background: var(--athera-blue-deep); }
.overlay .o-foot { font-family: var(--athera-mono); font-size: 11px; color: rgba(255, 255, 255, 0.35); }

/* ============================================================================
   Placeholder (results)
   ========================================================================== */

.placeholder-run { display: grid; gap: 18px; max-width: 640px; }
.placeholder-run .run-meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; }
.placeholder-run .run-meta dt { font-size: 11px; }
.placeholder-run .run-meta dd { margin: 0; font-family: var(--athera-mono); font-size: 13px; color: var(--athera-charcoal); }

@media (max-width: 900px) {
  .data-grid, .radio-list, .sku-grid, .how .steps { grid-template-columns: 1fr; }
}
