/* ============================================================
   TXT2CAR — Main Stylesheet
   Dark Green & Grey palette
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Space+Grotesk:wght@400;500;600;700&display=swap');
@import url('https://unpkg.com/@phosphor-icons/web@2.1.1/src/regular/style.css');

/* ---------- CSS Variables ---------- */
:root {
  --c-bg:         #F4F6F4;
  --c-surface:    #FFFFFF;
  --c-border:     #D6E0D6;
  --c-primary:    #2D6A4F;
  --c-primary-d:  #1B4332;
  --c-primary-l:  #D8EDE3;
  --c-accent:     #52796F;
  --c-accent-l:   #CAD8D4;
  --c-text:       #1C2B22;
  --c-muted:      #5A7265;
  --c-danger:     #cc0000;
  --c-success:    #27AE60;
  --c-plate-bg:   #EDF5F0;
  --c-plate-bd:   #2D6A4F;

  --radius-sm:    6px;
  --radius:       12px;
  --radius-lg:    20px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.07);
  --shadow:       0 4px 16px rgba(0,0,0,.09);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.13);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --nav-h:        64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ---------- Typography ---------- */
h1,h2,h3,h4,h5 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p  { font-size: 1rem; color: var(--c-muted); }

/* ---------- Layout helpers ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.section    { padding: 5rem 0; }
.section--sm { padding: 3rem 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 2rem; }
@media(max-width:768px){
  .grid-2,.grid-3 { grid-template-columns: 1fr; }
}

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--c-primary-d);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow-sm);
}
.nav__inner {
  max-width: 1100px; margin: 0 auto; padding: 0 1.5rem;
  height: 100%; display: flex; align-items: center; justify-content: flex-end;
}
.nav__links { display: flex; align-items: center; gap: 1.5rem; }
.nav__links a { font-weight: 500; color: rgba(255,255,255,.85); transition: color .2s; }
.nav__links a:hover { color: #fff; text-decoration: none; }
.nav__links .btn { margin-left: .5rem; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: .95rem;
  cursor: pointer; border: none; transition: all .2s;
  text-decoration: none;
}
.btn--primary   { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-d); text-decoration: none; color:#fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(45,106,79,.35); }
.btn--outline   { background: transparent; border: 2px solid rgba(255,255,255,.5); color: #fff; }
.btn--outline:hover { background: rgba(255,255,255,.25); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.btn--outline--dark { background: transparent; border: 2px solid var(--c-primary); color: var(--c-primary); }
.btn--outline--dark:hover { background: var(--c-primary); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(45,106,79,.35); }
.btn--accent    { background: var(--c-accent); color: #fff; }
.btn--accent:hover { background: var(--c-primary-d); text-decoration: none; color:#fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(45,106,79,.35); }
.btn--ghost     { background: transparent; color: var(--c-muted); border: 1.5px solid var(--c-border); }
.btn--ghost:hover { background: var(--c-primary-l); color: var(--c-primary-d); text-decoration: none; transform: translateY(-1px); }
.btn--danger    { background: var(--c-danger); color: #fff; }
.btn--danger:hover { background: #a30000; color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(204,0,0,.35); }
.btn--sm        { padding: .4rem 1rem; font-size: .85rem; }
.btn--lg        { padding: .9rem 2.2rem; font-size: 1.05rem; border-radius: var(--radius); }
.btn--full      { width: 100%; justify-content: center; }
.btn:disabled   { opacity: .5; cursor: not-allowed; }

/* ---------- PLATE WIDGET ---------- */
.plate-form {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  max-width: 540px;
}
.plate-form__title { font-size: 1.4rem; margin-bottom: 1.5rem; color: var(--c-text); }
.plate-display {
  display: flex; align-items: center; justify-content: center;
  background: var(--c-plate-bg);
  border: 3px solid var(--c-plate-bd);
  border-radius: var(--radius);
  padding: 1rem 2rem; margin: 1rem 0;
  font-family: var(--font-display); font-size: 2rem; font-weight: 700;
  letter-spacing: .15em; color: var(--c-text);
  min-height: 80px;
}

/* ---------- FORM ELEMENTS ---------- */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: .4rem; font-size: .9rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 1rem;
  background: var(--c-surface); color: var(--c-text);
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(45,106,79,.12);
}
.form-group textarea { resize: vertical; min-height: 130px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width:520px){ .form-row { grid-template-columns: 1fr; } }
.form-hint { font-size: .8rem; color: var(--c-muted); margin-top: .3rem; }
.form-error { font-size: .85rem; color: var(--c-danger); margin-top: .3rem; }

/* ---------- CARD ---------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.card--hover { transition: box-shadow .2s, transform .2s; cursor: pointer; }
.card--hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* ---------- NOTE CARD ---------- */
.note-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
  position: relative;
}
.note-card.unread { border-left: 4px solid var(--c-primary); }
.note-card.archived { background: #F9FAFB; }
.note-card.blocked-note { background: #F3F4F6; }
.note-card__meta { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; padding-right: 2rem; }
.note-card__author { font-weight: 600; font-size: .9rem; }
.note-card__date   { font-size: .82rem; color: var(--c-muted); }
.note-card__body   { color: var(--c-text); line-height: 1.7; }
.note-card__actions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: .2rem .6rem;
  border-radius: 99px; font-size: .75rem; font-weight: 600;
}
.badge--new     { background: var(--c-primary-l); color: #000000; font-weight: 600; }
.badge--flagged { background: #FDECEA; color: var(--c-danger); }
.badge--blocked { background: #FEE2E2; color: #e03131; font-weight: 700; }
.badge--archived { background: #E5E7EB; color: #000000; }
.badge--unverified { background: #FFD700; color: #1B4332; font-weight: 700; }

/* ── Note hamburger menu ── */
.note-menu { position: absolute; top: 1rem; right: 1rem; z-index: 1; }
.note-card:has(.note-menu__dropdown.open) { z-index: 400; isolation: isolate; }
.note-menu__btn {
  background: none; border: none; cursor: pointer;
  width: 2rem; height: 2rem; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--c-muted);
  transition: background .15s, color .15s;
}
.note-menu__btn:hover { background: var(--c-border); color: var(--c-text); }
.note-menu__dropdown {
  position: absolute; top: 2.2rem; right: 0;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 220px; z-index: 500;
  display: none; flex-direction: column; overflow: hidden;
}
.note-menu__dropdown.open { display: flex; }
.note-menu__item {
  padding: .65rem 1rem; font-size: .88rem; cursor: pointer;
  border: none; background: none; text-align: left; color: var(--c-text);
  display: flex; align-items: center; gap: .5rem;
  transition: background .12s;
  white-space: nowrap;
}
.note-menu__item:hover { background: var(--c-primary-l); color: var(--c-primary-d); }
.note-menu__item--danger { color: var(--c-danger); }
.note-menu__item--danger:hover { background: #FEF2F2; color: var(--c-danger); }
.note-menu__divider { border: none; border-top: 1px solid var(--c-border); margin: .25rem 0; }

/* ---------- HERO ---------- */
.hero {
  background: linear-gradient(135deg, var(--c-primary-d) 0%, #2D6A4F 60%, #354F52 100%);
  padding: 5rem 0 4rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.hero__tag {
  display: block;
  position: relative;
  width: fit-content;
  background: #E8EDE9;
  color: #1B4332;
  font-weight: 600; font-size: .85rem;
  border-radius: 99px; padding: .35rem 1rem;
  margin-bottom: 1.5rem;
}
.hero__tag::after {
  content: '';
  position: absolute;
  bottom: -14px;
  right: 33px;
  width: 0; height: 0;
  border-top: 14px solid #E8EDE9;
  border-left: 0px solid transparent;
  border-right: 18px solid transparent;
}
.hero__title { color: #fff; margin-bottom: 1.25rem; }
.hero__title span { color: #95D5B2; }
.hero__sub { font-size: 1.15rem; margin-bottom: 2rem; color: rgba(255,255,255,.75); }
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__counter { margin-top: 1.5rem; font-size: .9rem; color: #ffffff; }
.hero__counter strong { color: #fff; }
@media(max-width:768px){ .hero__inner { grid-template-columns: 1fr; } .hero__form { display: none; } }

/* ---------- SECTION HEADINGS with spacing ---------- */
.section-head { margin-bottom: 3rem; }
.section-head h2 { margin-bottom: 1rem; }
.section-head p  { max-width: 600px; margin: 0 auto 1.5rem; }

/* ---------- STEPS ---------- */
.step-number {
  width: 48px; height: 48px;
  background: var(--c-primary);
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  margin-bottom: 1rem; flex-shrink: 0;
}

/* ---------- ALERT ---------- */
.alert { padding: .85rem 1.1rem; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 1rem; }
.alert--success { background: #EAFAF1; border: 1px solid #A9DFBF; color: #1E8449; }
.alert--error   { background: #FDEDEC; border: 1px solid #F5B7B1; color: #922B21; }
.alert--info    { background: var(--c-primary-l); border: 1px solid #A8D5BE; color: var(--c-primary-d); }

/* ---------- PAGE WRAPPER ---------- */
.page-wrap { max-width: 680px; margin: 3rem auto; padding: 0 1.5rem; }
.page-wrap--wide { max-width: 900px; }

/* ---------- INBOX toolbar ---------- */
.inbox-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.inbox-filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.filter-btn { padding: .4rem .9rem; border-radius: 99px; border: 1.5px solid var(--c-border); background: var(--c-surface); font-size: .85rem; cursor: pointer; font-weight: 500; transition: all .15s; position: relative; }
.filter-btn.active, .filter-btn:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.filter-btn.active::after { content: ''; position: absolute; bottom: -14px; left: 1.2rem; width: 0; height: 0; border-top: 14px solid var(--c-primary); border-left: 0px solid transparent; border-right: 18px solid transparent; display: block; z-index: 2; }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--c-surface); border-radius: var(--radius-lg);
  padding: 2.5rem; max-width: 500px; width: 100%;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px); transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }

/* ---------- FOOTER ---------- */
.footer {
  background: var(--c-bg); color: var(--c-muted);
  padding: 0;
  margin-top: 0;
}
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; padding: 0 0; }
.footer .container { padding-top: 0; padding-bottom: 0; }
.footer__brand p { margin-top: .75rem; font-size: .9rem; color: var(--c-muted); }
.footer__logo { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.footer__logo img { height: 128px; width: auto; }
.footer h4 { font-family: var(--font-display); color: var(--c-text); margin-bottom: .75rem; font-size: 1rem; }
.footer a { color: var(--c-muted); font-size: .9rem; display: block; margin-bottom: .4rem; transition: color .15s; }
.footer a:hover { color: var(--c-primary); text-decoration: none; }
.safety-banner { width: 100%; background: #cc0000; color: #FFD700; font-weight: bold; text-align: center; height: 50px; line-height: 50px; font-size: 1rem; box-sizing: border-box; margin-top: 50px; margin-bottom: 50px; }
.footer__bottom { background: #1B4332; border-top: none; margin: 50px -9999px 0; padding: 0 9999px; height: 50px; line-height: 50px; text-align: center; font-size: .85rem; color: #ffffff; }
.footer__bottom p { color: #ffffff; }
.btn--light { background: #ffffff; color: var(--c-primary-d); }
.btn--light:hover { background: #e8f5ee; color: var(--c-primary-d); text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.plate-tab { display:inline-flex;align-items:center;gap:.4rem;padding:.2rem .75rem;border-radius:6px;font-size:1.05rem;font-weight:700;font-family:var(--font-display);letter-spacing:.08em;border:2px solid var(--c-plate-bd);cursor:pointer;transition:all .15s;white-space:nowrap; }
.plate-tab.active { border-color: var(--c-plate-bd); }
.note-card__plate-tag { display:inline-block;padding:.2rem .75rem;border-radius:6px;font-size:1.05rem;font-weight:700;letter-spacing:.08em;font-family:var(--font-display);white-space:nowrap;border:2px solid var(--c-plate-bd); }
@media(max-width:768px){ .footer__inner { grid-template-columns: 1fr; } }

/* ---------- RANDOM NOTES ---------- */
.random-note-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-primary);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  animation: fadeIn .4s ease both;
}
.random-note-card__plate {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.1rem; letter-spacing: .1em;
  background: var(--c-plate-bg); border: 2px solid var(--c-plate-bd);
  display: inline-block; padding: .2rem .75rem; border-radius: 6px;
  margin-bottom: .75rem;
}

/* ---------- UTILITIES ---------- */
.text-center { text-align: center; }
.text-muted   { color: var(--c-muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.divider { border: none; border-top: 1px solid var(--c-border); margin: 1.5rem 0; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.fade-in { animation: fadeIn .4s ease both; }
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* ---------- COLOR SWATCHES ---------- */
.color-swatches { display: flex; flex-wrap: nowrap; gap: .35rem; margin-top: .4rem; overflow: visible; padding: .4rem .2rem; }
.color-swatch {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  flex-shrink: 0; transition: transform .2s, border-color .15s, box-shadow .2s;
  position: relative;
}
.color-swatch:hover { transform: scale(1.25); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.color-swatch.selected { border-color: var(--c-text); transform: scale(1.25); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.color-swatch.swatch-other {
  background: #D1D5DB;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: #6B7280; letter-spacing: .05em;
}