/* ===================================================
   AutoCMA — main.css  (brand: gold/dark)
   =================================================== */

:root {
  --gold:      #ffb650;
  --gold-dark: #e6a240;
  --dark:      #1a1a2e;
  --dark2:     #16213e;
  --text:      #4e4e4e;
  --text-light:#777;
  --border:    #e8eaed;
  --bg-light:  #f7f8fa;
  --white:     #ffffff;
  --success:   #28a745;
  --danger:    #dc3545;
  --warning:   #ffc107;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 4px 20px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ── Typography ── */
h1, h2, h3, h4, h5 {
  color: var(--dark);
  font-weight: 800;
  line-height: 1.25;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

/* ── Site Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--dark);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.site-logo {
  text-decoration: none;
  flex-shrink: 0;
}
.logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: .04em;
  color: var(--white);
}
.logo-accent { color: var(--gold); }

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav a {
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s;
}
.site-nav a:hover { color: var(--gold); text-decoration: none; }
.site-nav .nav-btn {
  background: var(--gold);
  color: var(--dark) !important;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: .875rem;
}
.site-nav .nav-btn:hover { background: var(--gold-dark); text-decoration: none; }

/* ── Nav Dropdown ── */
.nav-dropdown { position: relative; display: flex; align-items: center; }
/* Extend hover-capture area to cover the gap between button and menu */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
}
.nav-dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  transition: color .15s;
}
.nav-dropdown-btn:hover,
.nav-dropdown.open .nav-dropdown-btn { color: var(--gold); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  overflow: hidden;
  z-index: 300;
}
/* invisible bridge covers the 12px gap so hover isn't lost */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}
.nav-dropdown-menu a {
  display: block;
  padding: 12px 18px;
  color: var(--dark) !important;
  font-size: .875rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  text-decoration: none;
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { background: var(--bg-light); color: var(--dark) !important; text-decoration: none; }
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all .2s;
}

/* ── Site Footer ── */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,.7);
  padding: 64px 24px 0;
}
.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 48px;
  padding-bottom: 48px;
}
.footer-brand .site-logo { margin-bottom: 16px; }
.footer-brand p {
  font-size: .875rem;
  line-height: 1.6;
  max-width: 280px;
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.footer-col h4 {
  color: var(--white);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  color: rgba(255,255,255,.6);
  font-size: .875rem;
  margin-bottom: 8px;
  text-decoration: none;
  transition: color .15s;
}
.footer-col a:hover { color: var(--gold); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 0;
  text-align: center;
}
.footer-bottom p { font-size: .8rem; color: rgba(255,255,255,.4); }

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-sm { max-width: 600px; }
.container-md { max-width: 860px; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--gold);
  color: var(--dark);
  border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--dark); }
.btn-outline {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}
.btn-outline:hover { background: var(--gold); color: var(--dark); }
.btn-outline-white {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.5);
}
.btn-outline-white:hover { background: rgba(255,255,255,.1); border-color: var(--white); color: var(--white); }
.btn-dark {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
}
.btn-dark:hover { background: var(--dark2); color: var(--white); }
.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-sm { padding: 8px 18px; font-size: .85rem; }
.btn-block { display: block; width: 100%; }

/* ── Section spacing ── */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-title {
  text-align: center;
  margin-bottom: 48px;
}
.section-title h2 { margin-bottom: 12px; }
.section-title p { color: var(--text-light); font-size: 1.05rem; max-width: 540px; margin: 0 auto; }
.badge-label {
  display: inline-block;
  background: rgba(255,182,80,.15);
  border: 1px solid rgba(255,182,80,.4);
  color: var(--gold);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

/* ── Cards ── */
.card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow); }
.card.featured {
  border-color: var(--gold);
  box-shadow: 0 4px 24px rgba(255,182,80,.18);
}

/* ── Pricing cards grid ── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  max-width: 1020px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow .2s;
}
.pricing-card:hover { box-shadow: var(--shadow); }
.pricing-card.featured {
  border-color: var(--gold);
  box-shadow: 0 4px 24px rgba(255,182,80,.2);
}
.pricing-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--white);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 16px;
  border-radius: 20px;
  white-space: nowrap;
}
.pricing-name {
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.pricing-price {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1;
  margin-bottom: 4px;
}
.pricing-price sup {
  font-size: 1.2rem;
  font-weight: 700;
  vertical-align: super;
}
.pricing-price span {
  font-size: .9rem;
  font-weight: 400;
  color: var(--text-light);
}
.pricing-desc {
  font-size: .875rem;
  color: var(--text-light);
  margin: 12px 0 22px;
  line-height: 1.55;
}
.pricing-features {
  list-style: none;
  margin: 0 0 28px;
  flex: 1;
}
.pricing-features li {
  font-size: .875rem;
  color: #444;
  padding: 7px 0;
  border-bottom: 1px solid #f0f2f5;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.45;
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li::before {
  content: '✓';
  color: var(--gold);
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}
.pricing-features li.section-label {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #aaa;
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 6px;
}
.pricing-features li.section-label::before { content: ''; }

/* ── Auth forms ── */
.auth-wrap {
  min-height: 100vh;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 44px;
  width: 100%;
  max-width: 460px;
}
.auth-card .auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-card .logo-text { color: var(--dark); }
.auth-card h2 {
  font-size: 1.5rem;
  margin-bottom: 6px;
  text-align: center;
}
.auth-card .auth-sub {
  text-align: center;
  color: var(--text-light);
  font-size: .9rem;
  margin-bottom: 28px;
}
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}
.form-control {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255,182,80,.15);
}
.form-hint {
  font-size: .8rem;
  color: var(--text-light);
  margin-top: 4px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: .9rem;
  border-left: 4px solid transparent;
}
.alert-success { background: #d4edda; color: #155724; border-color: var(--success); }
.alert-danger   { background: #f8d7da; color: #721c24; border-color: var(--danger); }
.alert-warning  { background: #fff3cd; color: #856404; border-color: var(--warning); }
.alert-info     { background: #d1ecf1; color: #0c5460; border-color: #17a2b8; }

/* ── Feature list ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}
.feature-item { text-align: center; }
.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
}
.feature-item h3 { font-size: 1rem; margin-bottom: 8px; }
.feature-item p { font-size: .875rem; color: var(--text-light); line-height: 1.6; }

/* ── Hero ── */
.hero {
  background: var(--dark);
  color: var(--white);
  padding: 100px 24px;
  text-align: center;
}
.hero h1 { color: var(--white); margin-bottom: 20px; }
.hero p {
  color: rgba(255,255,255,.75);
  font-size: 1.1rem;
  max-width: 580px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Dividers ── */
.divider { height: 1px; background: var(--border); margin: 0 auto; }

/* ── Password strength ── */
.password-strength {
  height: 4px;
  border-radius: 2px;
  margin-top: 8px;
  background: #e9ecef;
  overflow: hidden;
}
.password-strength-bar { height: 100%; width: 0; transition: all .3s; }
.strength-weak   { background: var(--danger);  width: 33%; }
.strength-medium { background: var(--warning); width: 66%; }
.strength-strong { background: var(--success); width: 100%; }

/* ── Nav user (authenticated state) ── */
.nav-user {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-user a:first-child {
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s;
}
.nav-user a:first-child:hover { color: var(--gold); }
.nav-btn-signout {
  background: transparent;
  color: rgba(255,255,255,.7) !important;
  border: 1px solid rgba(255,255,255,.3);
  padding: 7px 16px;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: border-color .15s, color .15s;
}
.nav-btn-signout:hover {
  border-color: rgba(255,255,255,.6);
  color: var(--white) !important;
}

/* ── Portal page ── */
.portal-wrap {
  min-height: calc(100vh - 64px - 260px);
  background: var(--bg-light);
  padding: 56px 0 80px;
}
.portal-greeting {
  text-align: center;
  margin-bottom: 44px;
}
.portal-greeting h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 6px;
}
.portal-greeting p {
  color: var(--text-light);
  font-size: .95rem;
}
.portal-grid {
  display: grid;
  gap: 24px;
}
.portal-grid--2 { grid-template-columns: repeat(2, 1fr); max-width: 780px; margin: 0 auto; }
.portal-grid--3 { grid-template-columns: repeat(3, 1fr); }
.portal-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 28px 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  transition: box-shadow .2s, border-color .2s;
}
.portal-card:hover { box-shadow: var(--shadow); }
.portal-card--upgrade {
  background: var(--bg-light);
  border-style: dashed;
}
.portal-card__icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,182,80,.12);
  border-radius: 12px;
  color: var(--gold-dark);
}
.portal-card--upgrade .portal-card__icon {
  background: rgba(0,0,0,.04);
  color: #bbb;
}
.portal-card__content { flex: 1; min-width: 0; }
.portal-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.portal-card__header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}
.portal-tier-badge {
  display: inline-block;
  background: rgba(255,182,80,.15);
  border: 1px solid rgba(255,182,80,.4);
  color: var(--gold-dark);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}
.portal-tier-badge--idx {
  background: rgba(26,26,46,.06);
  border-color: rgba(26,26,46,.18);
  color: var(--dark);
}
.portal-tier-badge--hot {
  background: rgba(220,53,69,.08);
  border-color: rgba(220,53,69,.3);
  color: #c0392b;
}
.portal-card__desc {
  color: var(--text-light);
  font-size: .875rem;
  line-height: 1.6;
  margin-bottom: 18px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--dark);
    flex-direction: column;
    padding: 20px 24px 28px;
    gap: 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    z-index: 199;
  }
  .site-nav.open { display: flex; }
  .site-nav .nav-btn { text-align: center; }
  .site-header { position: relative; }
  .site-header__inner { position: relative; }

  /* Mobile dropdown — inline expand */
  .nav-dropdown { flex-direction: column; align-items: flex-start; gap: 0; }
  .nav-dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    background: rgba(255,255,255,.06);
    border-radius: var(--radius);
    min-width: 0;
    width: 100%;
    margin-top: 8px;
  }
  .nav-dropdown-menu a {
    color: rgba(255,255,255,.8) !important;
    padding: 10px 14px;
    border-bottom-color: rgba(255,255,255,.08);
  }
  .nav-dropdown-menu a:hover { background: rgba(255,255,255,.1); color: var(--gold) !important; }
  /* On mobile use click/JS toggle — disable CSS hover */
  .nav-dropdown:hover .nav-dropdown-menu { display: none; }
  .nav-dropdown.open .nav-dropdown-menu { display: block; }

  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-links { grid-template-columns: repeat(2, 1fr); }

  .auth-card { padding: 36px 24px; }
  .form-row { grid-template-columns: 1fr; }

  .portal-grid--2,
  .portal-grid--3 { grid-template-columns: 1fr; }
  .portal-card { flex-direction: column; gap: 14px; }
  .nav-user { flex-direction: column; align-items: flex-start; gap: 10px; }

  .hero { padding: 72px 24px; }
  .hero-btns { flex-direction: column; align-items: center; }

  .section { padding: 56px 0; }
}

@media (max-width: 480px) {
  .footer-links { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
}
