/* ========================================================================== */
/* 1) DESIGN TOKENS (CUSTOM PROPERTIES / THEMES)                              */
/*    Put first so everything else can consume them.                          */
/* ========================================================================== */
:root {
  --primary: #000;
  --accent: #CC0014;
  --hover: #B7CC00;
  --text-gray: #4A5568;
  --bg-light: #F7FAFC;
  --white: #FFFFFF;
}

/* Theme overrides: attach class to <html> or a wrapper to swap palettes */
.colorblind-deuteranopia {
  --primary: #000;
  --accent: #FFD43B;
  --hover: #FF6F91;
  --text-gray: #4A5568;
  --bg-light: #F7FAFC;
  --white: #fff;
}

.colorblind-protanopia {
  --primary: #000;
  --accent: #F4B400;
  --hover: #5C4DFF;
  --text-gray: #4A5568;
  --bg-light: #F7FAFC;
  --white: #FFFFFF;
}

/* ========================================================================== */
/* 2) GLOBAL RESETS & BASE                                                    */
/*    Lowest specificity: element/universal selectors first.                  */
/* ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: Arial, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-gray);
  line-height: 1.6;
}

/* Focus styles grouped to be consistent and discoverable */
#nav-list li a { color: var(--white);}
a:focus-visible,
button:focus-visible,
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:focus-visible,
.hero .btn:focus-visible { outline: 3px solid var(--hover); outline-offset: 2px; }

/* Accessibility helpers (utility classes; keep simple & global) */
.visually-hidden,
.sr-only,
.hidden-field {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================================================== */
/* 3) PAGE LAYOUT                                                             */
/*    Wrappers and grids before components that live inside them.             */
/* ========================================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(16px, 1fr) minmax(700px, 1100px) minmax(16px, 1fr);
  gap: 1.5rem;
  align-items: start;
  width: 100%;
}

.left-aside { grid-column: 1; }
.layout > main { grid-column: 2; }
.right-aside { grid-column: 3; }

main > section { margin: 1.25rem 0; }
main > section + section { margin-top: 1.5rem; }

.left-aside,
.right-aside {
  position: static;
  top: auto;
  align-self: start;
  display: grid;
  gap: 1rem;
}

.left-aside > *,
.right-aside > * {
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* ========================================================================== */
/* 4) SITE CHROME: HEADER, NAV, FOOTER, BANNERS                               */
/* ========================================================================== */
header { background-color: var(--primary); color: var(--white); }

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

nav ul { list-style: none; display: flex; gap: 1rem; }
nav select { padding: 0.3rem; border-radius: 4px; }
header nav[aria-label="Primary"] a { color: var(--white); text-decoration: none; font-weight: bold; }

footer {
  background-color: var(--primary);
  color: var(--white);
  padding: 1rem;
  text-align: center;
  margin-top: 2rem;
}
footer a { color: var(--white); }

/* Banners */
.banner,
.site-banner {
  background: var(--primary);
  color: var(--white);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin: 1rem 0;
}
.banner .banner-msg,
.site-banner .banner-msg { margin: 0; font-weight: 600; }

/* Section nav (in-page TOC style) */
.section-nav ul {
  list-style: none;
  color: var(--primary);
  padding: 0;
  margin: 0;
  display: grid;
  gap: .4rem;
}
.section-nav a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}
.section-nav a:hover { color: var(--accent); }
.section-nav a:visited { color: var(--primary); }

/* Mobile menu toggle (hidden on desktop) */
.menu-toggle {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  cursor: pointer;
}

/* ========================================================================== */
/* 5) GENERIC COMPONENTS & UTILITIES                                          */
/*    Base styles first, then variants, then state (hover/focus).             */
/* ========================================================================== */

/* CTAs */
.cta-slot {
  margin-bottom: 1rem;
  position: sticky;
  top: 0.5rem;
  z-index: 2;
}
.cta-slot .btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  background-color: var(--accent);
  color: var(--white);
  text-decoration: none;
  transition: background-color 0.3s;
}

/* Link-styled button */
.btn.btn-link {
  background: transparent;
  color: var(--primary);
  text-decoration: underline;
  padding: 0;
}

/* Simple lists and FAQs */
.value-intro .bullets-simple { margin: .5rem 0 0; padding-left: 1rem; }
.value-intro .bullets-simple li { margin: .25rem 0; }

.faq details {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: .75rem 1rem;
  margin: .5rem 0;
}
.faq summary { cursor: pointer; font-weight: 600; }

/* Compare table (generic) */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: #fff;
}
.compare-table th, .compare-table td {
  border: 1px solid #ddd;
  padding: .6rem .8rem;
  text-align: left;
}
.compare-table thead th { background: #000; color: #fff; }
.compare .note { color: var(--text-gray); font-size: .95rem; }

/* Quick actions */
.quick-actions .actions {
  display: grid;
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: .5rem 0 0;
}
.quick-actions .btn { display: block; text-align: center; }
.quick-actions .actions li { margin: .25rem 0; }

/* Cards & grid helpers */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: var(--white);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.card h4 { color: var(--accent); margin-bottom: 0.5rem; }
.card p { font-size: 1.2rem; font-weight: bold; }
.card ul { margin-top: 0.5rem; list-style: disc inside; color: var(--text-gray); }

/* Muted/soft sections */
.box-muted {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background-color: #f5f8fa;
}
.section-soft { background-color: var(--bg-light); padding: 1rem; border-radius: 8px; margin: 1rem 0; }

/* Anchor scroll offset for in-page links */
[id] { scroll-margin-top: 80px; }

/* ========================================================================== */
/* 6) CONTENT SECTIONS                                                         */
/* ========================================================================== */

/* Hero */
main .hero {
  background-color: var(--white);
  padding: 2rem;
  text-align: center;
  margin-top: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
}
.hero h2 { color: var(--primary); margin-bottom: 1rem; }
.hero .btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  background-color: var(--accent);
  color: var(--white);
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s;
}
.hero .btn:hover { background-color: var(--hover); }

/* Services section */
.services { display: grid; gap: 1rem; }
.service {
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.service h3 { color: var(--accent); margin-bottom: .35rem; letter-spacing: .2px; }
.service .intro { color: var(--text-gray); margin: .25rem 0 .5rem; }
.service .features { margin: .25rem 0 .75rem; padding-left: 1.1rem; list-style: disc; }
.service details summary { cursor: pointer; font-weight: 600; }
.service .mini { list-style: disc; padding-left: 1.2rem; margin: .35rem 0; }
.service .meta { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--text-gray); }
.service .actions { margin-top: .5rem; display: flex; gap: .5rem; flex-wrap: wrap; }

/* Toolbar above services */
.svc-toolbar { display: grid; gap: .5rem; margin: .5rem 0 1rem; }
#svc-search {
  max-width: 420px;
  width: 100%;
  padding: .45rem .6rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}

/* Pricing / tiers */
section.tiers { margin-top: 2rem; }
section.tiers h3 { margin-bottom: 1rem; color: var(--primary); text-align: center; }

.tiers .grid { align-items: stretch; }

.tier {
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tier h4 { color: var(--accent); font-size: 1.15rem; margin-bottom: .35rem; letter-spacing: .2px; }
.tier .price {
  display: flex;
  align-items: baseline;
  gap: .25rem;
  font-weight: 800;
  color: var(--primary);
  font-size: 1.6rem;
  line-height: 1.1;
  margin: .25rem 0 .75rem;
}
.tier .price .currency { font-size: .9rem; font-weight: 700; opacity: .9; }
.tier .price .per { font-size: .9rem; font-weight: 600; color: var(--text-gray); margin-left: .15rem; }
.tier .price .amount { font-variant-numeric: tabular-nums; }
.tier .features {
  margin-top: .25rem;
  padding-left: 1.1rem;
  display: grid;
  gap: .35rem;
  list-style: disc;
  color: var(--text-gray);
  margin-bottom: .75rem;
}
.tier .features li::marker { color: var(--accent); }
.tier .best-for { margin: .5rem 0 1rem; color: var(--text-gray); }
.tier .tier-cta {
  margin-top: auto;
  width: max-content; /* use align-self: stretch for full width */
  align-self: start;
  padding: .45rem 1rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
  transition: background-color .2s ease;
}
.tier:hover,
.tier:focus-within {
  border-color: var(--accent);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.tier .tier-cta:hover,
.tier .tier-cta:focus-visible { background: var(--hover); outline: none; }

/* Featured plan variant AFTER base */
.tier.featured {
  border-color: var(--accent);
  background:
    linear-gradient(0deg, #fff, #fff) padding-box,
    linear-gradient(120deg, var(--accent), transparent 60%) border-box;
  box-shadow: 0 6px 14px rgba(204, 0, 20, 0.1);
}

/* Rate card (separate from compare-table) */
.rate-card {
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto;
  border-collapse: collapse;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.rate-card caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  padding: .5rem 0;
  color: var(--primary);
}
.rate-card thead { background-color: var(--primary); color: #fff; }
.rate-card tbody tr:nth-child(even) { background: #fafafa; color: var(--primary); }
.rate-card th, .rate-card td { border: 1px solid #000; padding: 0.75rem 1rem; text-align: left; }
.rate-card tr.highlight { background-color: #fffbe6; font-weight: bold; }

.rate-card-link {
  margin-top: 1rem;
  text-align: right;
  font-weight: bold;
}
.rate-card-link a {
  display: inline-block;
  text-decoration: underline;
  color: var(--primary);
  padding: .25rem .5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.rate-card-link a:hover { background-color: var(--hover); color: var(--accent); text-decoration: none; }

/* Right aside lists */
.right-aside ul { margin-top: .5rem; padding-left: 1rem; list-style: disc; }

/* Popups (IDs = highest specificity; placed later) */
#htmpPopup,
#htmlPopup {
  background-color: var(--primary);
  color: var(--white);
  display: none;
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #ccc;
  padding: 20px;
  z-index: 1000;
}

/* ========================================================================== */
/* 7) FORMS & CONTACT                                                          */
/* ========================================================================== */
.contact-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
  align-items: flex-start;
}

.contact-form { flex: 1 1 60%; max-width: 700px; }

.contact-form label,
.contact-form input,
.contact-form textarea,
.contact-form select,
.contact-form .g-recaptcha,
.contact-form .form-row,
.contact-form button,
.contact-form .form-feedback { grid-column: span 2; }

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="password"],
.contact-form textarea {
  width: 60%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.contact-form button {
  padding: 0.7rem 1.5rem;
  background-color: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.contact-form button:hover { background-color: var(--hover); }

.contact-form .form-feedback { margin-top: 1rem; color: red; font-weight: bold; }

.contact-image { flex: 1 1 35%; display: flex; justify-content: center; align-items: center; }
.contact-image img {
  max-width: 100%; height: auto; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Upload / actions */
#uploadForm { display: flex; flex-direction: column; gap: 0.8rem; }
#uploadForm input[type="file"] {
  border: 1px solid #ccc; padding: 0.3rem; border-radius: 4px;
}
#uploadForm button { align-self: flex-start; background-color: var(--accent); color: var(--white); }

/* ========================================================================== */
/* 8) DASHBOARD / FILE LIST UI                                                 */
/* ========================================================================== */
.dashboardContainer {
  justify-content: center;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem auto;
  text-align: center;
}

#fileList {
  flex: 2 1 600px;
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: .5rem;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
#fileList ul { list-style-type: none; padding-left: 0; }
#fileList li {
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
#fileList li input[type="checkbox"] { flex-shrink: 0; }
#fileList li button,
#fileList li a,
#fileList li span {
  flex-grow: 1;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
  padding: 0;
}
#fileList li span {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin-left: auto;
}

/* Controls panel */
.contact-card {
  flex: 1 1 300px;
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.action-group { display: flex; flex-direction: column; gap: 0.8rem; }
.action-group label { font-weight: 600; }
.action-group input[type="text"],
.action-group select {
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  width: 100%;
  box-sizing: border-box;
}
.action-group button {
  background-color: var(--accent);
  border: none;
  padding: 0.5rem 1rem;
  color: var(--white);
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}
.action-group button:hover { background-color: var(--hover); }

/* ========================================================================== */
/* 9) MEDIA QUERIES (OVERRIDES LAST)                                          */
/*    Ordered from widest breakpoint to smallest keeps intent readable.       */
/* ========================================================================== */

/* <= 900px: collapse the 3-col layout */
@media (max-width: 900px) {
  .container.layout { grid-template-columns: 1fr; }
  .left-aside, .right-aside, .layout > main { grid-column: 1; }
}

/* <= 768px: tablet – stack contact, tighten paddings, mobile nav dropdown */
@media (max-width: 768px) {
	header{min-height:0;}
	header img.logo{ max-height: 28px; height:auto;}
	header nav[aria-label="Primary"] a {
    font-weight: 600;          /* keep bold-ish feel */
    font-size: 0.95rem;        /* slightly smaller */
    line-height: 1.2;
    padding: 0.25rem 0;        /* reduce tap target height a bit */
  }
  .contact-wrapper { flex-direction: column; }
  .contact-form, .contact-image { flex: 1 1 100%; max-width: 100%; }

  main .hero,
  .card,
  .rate-card,
  .contact-card,
  #fileList {
    padding: 1rem;
    margin: 0.5rem;
    font-size: 0.95rem;
  }

  .grid { grid-template-columns: 1fr; }

  .rate-card th, .rate-card td { padding: 0.5rem; font-size: 0.9rem; }

  .dashboardContainer { flex-direction: column; align-items: stretch; gap: 1rem; }

  #uploadForm button { width: 100%; }
  .hero .btn, .rate-card-link { width: 100%; text-align: center; }

  .contact-form input[type="text"],
  .contact-form input[type="email"],
  .contact-form textarea { width: 100%; }

  .nav-bar { flex-direction: column; align-items: flex-start; position: relative; }
  .menu-toggle { display: block; margin-left: auto; color: white; z-index: 1100; }

  nav ul {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background-color: #000;
    flex-direction: column;
    width: 100%;
    padding: 1rem;
    border-top: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: all 0.3s ease-in-out;
  }
  nav ul.show { display: flex; }
  nav ul li { width: 100%; padding: 0.5rem 0; }
  nav a { color: var(--white); display: block; width: 100%; }
}

/* <= 480px: phone – tighter typography/paddings and controls */
@media (max-width: 480px) {
	header{min-height:0;}
	header nav[aria-label="Primary"] a {
		font-size: 0.9rem;
		padding:0.2rem 0;
	}
  header, footer { text-align: center; }
  header img.logo {
	max-height:24px;	
  }
  .hero h2 { font-size: 1.2rem; }
  .card h4, .card p { font-size: 1rem; }

  .rate-card th, .rate-card td { font-size: 0.85rem; padding: 0.4rem; }
  .contact-card, #fileList { padding: 0.5rem; }
  .action-group button { font-size: 0.9rem; padding: 0.4rem; }

  /* Repeat mobile nav constraints at smallest size for safety */
  .nav-bar { flex-direction: column; align-items: flex-start; position: relative; padding:0.35rem 0; }
  .menu-toggle { display: block; margin-left: auto; color: white; z-index: 1100; }
  nav ul {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background-color: #000;
    flex-direction: column;
    width: 100%;
    padding: 1rem;
    border-top: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: all 0.3s ease-in-out;
    gap:0.5rem;
  }
  nav ul.show { display: flex; padding: 0.5rem;}
  nav ul li { width: 100%; padding: 0.5rem 0; padding:0.35rem 0;}
  nav a { color: var(--white); display: block; width: 100%; }
}

/* ========================================================================== */
/* 10) REDUCED MOTION (AFTER COMPONENTS; BEFORE OR AFTER MQs is fine)         */
/* ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .tier { transition: none; transform: none !important; }
}
