/* evaluator.ai — black top bar, light content, bottom legal strip */
:root {
  --header-bg: #000000;
  --header-text: #ffffff;
  --header-muted: rgba(255, 255, 255, 0.72);
  --nav-active: #6d98a8;
  --page-bg: #ffffff;
  --panel-muted: #f4f4f2;
  --heading-green: #1e3d4d;
  --text-body: #2a2a2a;
  --text-muted: #5c5c5c;
  --border-light: #e0e0dc;
  --accent-link: #6d98a8;
  --accent-link-hover: #5a8494;
  --radius-panel: 10px;
  --radius-card: 12px;
  --font-sans: "Montserrat", system-ui, -apple-system, sans-serif;
  --max-width: 1180px;
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.06);
  --error: #b91c1c;
  --success-bg: #ecfdf5;
  --success-text: #047857;
  --success-border: #a7f3d0;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;
  --warning-border: #fde68a;
  /* Space reserved so scrollable content clears the fixed bottom bar (~nav height + breathing room) */
  --site-bottom-nav-reserve: 3.25rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--page-bg);
}

a {
  color: var(--accent-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-link-hover);
}

a:focus-visible {
  outline: 2px solid var(--accent-link);
  outline-offset: 2px;
}

/* ——— Top bar ——— */
.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
  background: var(--header-bg);
  color: var(--header-text);
}

.site-header__bar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--header-text) !important;
  flex-shrink: 0;
}

.site-brand:hover {
  color: var(--header-text) !important;
  opacity: 0.88;
}

.site-brand__mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  background: linear-gradient(135deg, #7fb5c6 0%, #6d98a8 100%);
  flex-shrink: 0;
}

.site-nav-main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  flex-wrap: wrap;
  gap: 0.15rem 1.35rem;
}

.site-nav-main > a,
.site-nav-main__auth a {
  padding: 0.35rem 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--header-text) !important;
  white-space: nowrap;
}

.site-nav-main > a:hover,
.site-nav-main__auth a:hover {
  color: var(--header-muted) !important;
}

.site-nav-main a.is-active {
  color: var(--header-text) !important;
  box-shadow: inset 0 -2px 0 0 var(--nav-active);
}

.site-nav-main__auth {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.site-nav-main__slash {
  color: var(--header-muted);
  font-size: 0.88rem;
  user-select: none;
}

.site-nav-logout-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

.site-nav-logout-btn {
  padding: 0.35rem 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--header-text);
  cursor: pointer;
  text-decoration: none;
}

.site-nav-logout-btn:hover {
  color: var(--header-muted);
}

.site-header__cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  flex-shrink: 0;
}

.site-header__cta-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--header-muted);
  margin-right: 0.25rem;
}

.site-header__cta-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--header-text) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-header__cta-link:hover {
  color: var(--nav-active) !important;
}

.site-header__cta-sep {
  color: var(--header-muted);
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .site-header__inner {
    justify-content: flex-start;
  }
  .site-nav-main {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
  .site-header__cta {
    margin-left: auto;
  }
}

/* ——— Main & cards ——— */
.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem
    calc(2.5rem + var(--site-bottom-nav-reserve) + env(safe-area-inset-bottom, 0px));
}

.site-main--center {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: none;
}

.site-main--landing {
  max-width: var(--max-width);
  padding-top: 2.25rem;
}

.card {
  background: var(--page-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 1.75rem 2rem;
}

.card--narrow {
  width: 100%;
  max-width: 420px;
}

.card--prose {
  width: 100%;
  max-width: 675px;
}

.card--hero {
  padding: 2rem 2rem 1.75rem;
}

@media (max-width: 640px) {
  .card {
    padding: 1.35rem 1.25rem;
  }
}

/* ——— Landing two-panel hero ——— */
.landing-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
  min-height: min(52vh, 520px);
}

@media (max-width: 768px) {
  .landing-panels {
    grid-template-columns: 1fr;
    min-height: unset;
  }
}

.landing-panel {
  border-radius: var(--radius-panel);
  overflow: hidden;
  min-height: 280px;
}

.landing-panel--text {
  background: var(--panel-muted);
  padding: 2.5rem 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.landing-brand__mark {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #7fb5c6 0%, #6d98a8 100%);
}

.landing-brand__text {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--heading-green);
}

.landing-headline {
  margin: 0 0 1rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.65rem, 2.8vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--heading-green);
}

.landing-body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 36rem;
}

.landing-body--cta {
  margin-top: 1.25rem;
  font-size: 0.95rem;
}

.landing-panel--visual {
  background: var(--panel-muted);
  position: relative;
}

.landing-panel--visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 280px;
}

/* ——— Typography (inner pages) ——— */
.display {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: var(--heading-green);
}

.lede {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 40rem;
}

.page-subheading {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
  color: var(--heading-green);
}

.section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.page-prose p {
  margin: 0 0 0.85rem;
  color: var(--text-body);
  max-width: 42rem;
}

.page-prose p:last-child {
  margin-bottom: 0;
}

.page-links {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.page-links a {
  font-weight: 500;
}

/* ——— Pricing ——— */
.pricing-tiers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.pricing-tier {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.35rem;
  background: #fff;
}

.pricing-tier--highlight {
  background: var(--panel-muted);
  border-color: #c5cdd4;
}

.pricing-tier__title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.pricing-tier__price {
  margin: 0 0 0.35rem;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--heading-green);
}

.pricing-tier__currency {
  font-size: 1.05rem;
  vertical-align: super;
  margin-right: 0.1rem;
}

.pricing-tier__usd {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pricing-tier__sub {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-link);
}

.pricing-tier__detail {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.pricing-tier__list {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.pricing-tier__list li {
  margin-bottom: 0.35rem;
}

.pricing-note {
  margin-top: 2rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 42rem;
}

.pricing-stripe {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.pricing-stripe__label {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.pricing-stripe__link {
  display: inline-block;
  line-height: 0;
}

.pricing-stripe__link:focus-visible {
  outline-offset: 4px;
}

.pricing-stripe__logo {
  height: 32px;
  width: auto;
  display: block;
}

.pricing-stripe__fine {
  margin: 1rem auto 0;
  max-width: 32rem;
  font-size: 0.68rem;
  line-height: 1.45;
  color: #888;
}

/* ——— Bottom navigation (fixed: always visible above page scroll) ——— */
.site-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 190;
  padding: 0.65rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-light);
  background: #fafaf9;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
}

.site-bottom-nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.site-bottom-nav__inner a {
  font-weight: 500;
  color: var(--text-muted);
}

.site-bottom-nav__inner a:hover {
  color: var(--accent-link);
}

.site-bottom-nav__sep {
  color: #b4b4b0;
  user-select: none;
}

/* ——— Forms ——— */
.form-stack label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-stack input[type="email"],
.form-stack input[type="password"],
.form-stack input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-body);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-stack .password-field {
  position: relative;
  margin-bottom: 1rem;
}

.form-stack .password-field input[type="password"],
.form-stack .password-field input[type="text"] {
  margin-bottom: 0;
  padding-right: 2.85rem;
}

.password-field__toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.password-field__toggle:hover {
  color: var(--accent-link);
  background: rgba(109, 152, 168, 0.08);
}

.password-field__toggle:focus-visible {
  outline: 2px solid var(--accent-link);
  outline-offset: 2px;
}

/* Stack both SVGs in the same spot; `display` toggles which one paints (`hidden` on <svg> is unreliable). */
.password-field__toggle .password-toggle__icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.password-field__toggle .password-toggle__icon--open {
  display: block;
}

.password-field__toggle .password-toggle__icon--shut {
  display: none;
}

.password-field__toggle[aria-pressed="true"] .password-toggle__icon--open {
  display: none;
}

.password-field__toggle[aria-pressed="true"] .password-toggle__icon--shut {
  display: block;
}

.form-stack input:focus {
  outline: none;
  border-color: var(--accent-link);
  box-shadow: 0 0 0 3px rgba(109, 152, 168, 0.15);
}

.form-stack .error {
  color: var(--error);
  font-size: 0.8rem;
  margin-top: -0.65rem;
  margin-bottom: 0.65rem;
}

.signup-paused {
  padding: 1.5rem 0 0.5rem;
  text-align: center;
  color: var(--text-body);
  line-height: 1.6;
}

.signup-paused a {
  color: var(--accent);
}

.btn-primary {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.78rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #6d98a8 0%, #5a8494 100%);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 2px 12px rgba(109, 152, 168, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: scale(0.99);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--accent-link);
  outline-offset: 3px;
}

.flash-success {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.message-banner {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.message-banner--error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.unverified-notice {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  pointer-events: none;
  z-index: 199;
}

.unverified-notice__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.4rem 1.5rem 0;
  text-align: right;
  font-size: 0.82rem;
  color: #b91c1c;
  pointer-events: all;
}

.unverified-notice__link {
  color: #b91c1c;
  text-decoration: none;
}

.unverified-notice__link:hover {
  font-weight: bold;
  color: #b91c1c;
}

.form-links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ——— Listings table ——— */
.empty-state {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 0.5rem 0;
}

.listings-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0.5rem;
}

.listings-table tr.pair-top td {
  padding: 1rem 0 0.35rem;
  border-bottom: none;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-body);
}

.listings-table .saved-date {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

.listings-table .listing-link {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--accent-link);
  margin-top: 3px;
  text-decoration: none;
}

.listings-table .listing-link:hover {
  text-decoration: underline;
}

.listings-table tr.pair-bottom td {
  padding: 0 0 1.25rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  font-size: 0.9rem;
}

.listings-table tr.pair-bottom td:last-child {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.listings-table details summary {
  cursor: pointer;
  color: var(--accent-link);
  font-weight: 600;
  font-size: 0.85rem;
  user-select: none;
  list-style: none;
}

.listings-table details summary::-webkit-details-marker {
  display: none;
}

.listings-table details summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.listings-table details[open] summary::before {
  transform: rotate(90deg);
}

.assessment-body {
  margin-top: 0.55rem;
  white-space: normal;
  word-break: break-word;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: var(--panel-muted);
  border: 1px solid var(--border-light);
}

.btn-delete {
  padding: 0.4rem 0.7rem;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-delete:hover {
  background: #fee2e2;
}

/* ——— Saved listing: title row, price, image, expiry ——— */

.saved-title-text {
  display: block;
  font-weight: 600;
}

.saved-price-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 2px;
}

.saved-price {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-link);
  white-space: nowrap;
}

.saved-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 2px;
}

.saved-expiry {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.saved-expiry--warning {
  color: #b45309;
  font-weight: 600;
}

.saved-image-cell {
  width: 140px;
  min-width: 140px;
  vertical-align: top;
  padding-top: 1rem;
  padding-left: 1rem;
}

.saved-listing-image {
  display: block;
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

/* ——— Assessment structured layout (saved listings expand view) ——— */

.assessment-rating {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.assessment-rating--good_value { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.assessment-rating--fair       { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.assessment-rating--overpriced { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.assessment-rating--uncertain  { background: #f4f4f2; color: #5c5c5c; border: 1px solid #e0e0dc; }

.assessment-verdict {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-body);
  margin: 0 0 10px;
  line-height: 1.5;
}

.assessment-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 10px 0 4px;
}

.assessment-section-label--red-flags { color: #047857; }
.assessment-section-label--pros      { color: #047857; }
.assessment-section-label--cons      { color: var(--text-muted); }

.assessment-list {
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
}

.assessment-list li {
  font-size: 0.82rem;
  line-height: 1.45;
  padding-left: 18px;
  position: relative;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.assessment-list--red-flags { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 6px; padding: 6px 8px 6px 0; }
.assessment-list--red-flags li::before { content: "→"; position: absolute; left: 4px; color: #047857; font-size: 10px; top: 2px; }
.assessment-list--pros li::before      { content: "✓"; position: absolute; left: 0; color: #047857; font-weight: 700; }
.assessment-list--cons li::before      { content: "✗"; position: absolute; left: 0; color: #b91c1c; font-weight: 700; }

.assessment-analysis {
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
  margin-top: 6px;
}

.assessment-analysis p {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.saved-red-flags-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
