/* =========================================================
   MailSized UI (mockup-aligned theme)
   Keep existing IDs/classes so current JS keeps working.
   ========================================================= */

/* ---------- reset & basics ---------- */
* { box-sizing: border-box; }
:root{
  --bg: #f2f4f8;
  --card: #ffffff;
  --muted: #6b7280;
  --text: #1f2937;
  --border: #e5e7eb;
  --brand: #7c3aed;         /* purple primary */
  --brand-600: #6d28d9;
  --brand-700: #5b21b6;
  --brand-soft: #f3e8ff;
  --success: #28a745;
  --error-bg: #fde8e8;
  --error-border: #fca5a5;
  --error-text: #b91c1c;
  --shadow: 0 10px 25px rgba(17,24,39,.08);
  --radius: 14px;

  /* NEW tokens (non‑breaking) */
  --focus: rgba(124,58,237,.35);
  --brand-gradient: linear-gradient(90deg, var(--brand-600), var(--brand));
  --brand-ring: 0 0 0 4px #f3e8ff;
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, #f5f7fb 0%, #eef1f7 100%);
}

/* ---------- links ---------- */
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- container & layout ---------- */
.container {
  max-width: 1120px;
  margin: 32px auto;
  padding: 0 20px 28px;
}

.card-container{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
}
@media (max-width: 980px){
  .card-container{ grid-template-columns: 1fr; }
}

/* ---------- header/logo ---------- */
header{
  text-align: center;
  margin-bottom: 18px;
}
.logo{
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 26px;
}
.logo-icon{
  width: 38px; height: 38px; border-radius: 10px;
  display:flex; align-items:center; justify-content:center;
  background: var(--brand-soft); color: var(--brand-600);
  box-shadow: var(--shadow);
}
header p{
  margin: 6px 0 10px; color: var(--muted); font-size: 14px;
}
.constraint{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; font-size: 12px;
  background: #fff; border: 1px solid var(--border);
}

/* ---------- top navigation ---------- */
.top-nav{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-start;
  margin:8px 0 12px;
  font-size:13px;
  color:var(--muted);
}
.top-nav .top-nav-link{
  color:var(--brand-600);
  font-weight:700;
  text-decoration:none;
}
.top-nav .top-nav-link:hover{
  text-decoration:underline;
}
.top-nav .sep{ color:#c7c9d3; }

/* ---------- cards ---------- */
.main-card, .info-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.main-card{ padding: 18px; }
.info-card{ padding: 16px; }

/* ---------- ad slots ---------- */
.ad-slot{
  width:100%;
  min-height:180px;
  margin-top:15px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--card);
  box-shadow:var(--shadow);
  /* Ensure ad content doesn't overlap pricing details */
  position:relative;
  overflow:hidden;
}
.ad-placeholder{
  font-size:13px;
  color:var(--muted);
}

/* ---------- steps (top pills) ---------- */
.steps{
  display:flex; gap:6px; padding: 8px; background:#fafbff;
  border:1px solid var(--border); border-radius: 12px; overflow: hidden;
  margin-bottom: 12px;
}
.steps .step{
  flex:1; text-align:center; font-weight:600; font-size:12px;
  padding: 8px 6px; border-radius: 8px; color:#6b6f76;
}
.steps .step.active{
  background: var(--brand-soft); color: var(--brand-700);
  border: 1px solid #e9d5ff;
}

/* ---------- section titles ---------- */
.step-content{ padding: 6px; }
.step-title{
  font-size: 16px; margin: 14px 0 10px; display: flex; align-items: center; gap: 8px;
}
.step-title i{ color: var(--brand-600); }

/* ---------- upload area ---------- */
.upload-area{
  border: 2px dashed #d8dbe6;
  padding: 28px; text-align: center; background: #fff;
  border-radius: 12px; cursor: pointer;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.upload-area:hover{ border-color: var(--brand-600); box-shadow: var(--shadow); }
.upload-area.dragover{ border-color: var(--brand); background: #faf5ff; }
.upload-icon{
  width: 48px; height: 48px; margin: 0 auto 8px; border-radius: 12px;
  display:flex; align-items:center; justify-content:center;
  background: var(--brand-soft); color: var(--brand-600);
}

/* ---------- upload progress (top of flow) ---------- */
.progress-container{
  position: relative; height: 22px; border-radius: 999px;
  background: #eef2ff; overflow: hidden; border: 1px solid #e5e7eb;
}
.progress-fill{
  height: 100%; width: 0%;
  background: var(--brand-gradient);
  transition: width .35s ease;
}
.progress-pct{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size: 12px; font-weight:700; color:#fff; text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.progress-note{ margin-top:6px; color: var(--muted); font-size: 13px; }

/* ---------- file info row ---------- */
#fileInfo{
  display:flex; align-items:center; gap:12px; padding:10px 12px; margin-top:12px;
  background:#fafafa; border:1px solid var(--border); border-radius: 10px;
}
.file-icon{
  width:34px;height:34px;border-radius:8px;display:flex;align-items:center;justify-content:center;
  background:#eef2ff;color:var(--brand-600);
}
.file-name{ font-weight: 700; }
.file-meta{ font-size: 12px; color: var(--muted); display:flex; gap:10px; }
.remove-file{
  margin-left: auto; border: 1px solid var(--border); background:#fff; color:#6b7280;
  border-radius: 8px; padding:6px 8px; cursor:pointer;
}
.remove-file:hover{ background:#f8fafc; }

/* ---------- provider cards ---------- */
.providers{
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px;
}
.providers .provider-card{
  border:1px solid var(--border); background:#fff; border-radius: 12px;
  padding: 14px; cursor: pointer; text-align:center;
  transition: border-color .2s ease, box-shadow .2s ease, transform .05s ease;
}
.providers .provider-card:hover{ box-shadow: var(--shadow); }
.providers .provider-card.selected{
  border-color: #e9d5ff; box-shadow: 0 0 0 3px #f3e8ff inset;
}
.provider-icon{ font-size: 28px; color: var(--brand-600); margin-bottom: 6px; }
.provider-name{ font-weight: 800; margin-bottom: 4px; }
.provider-details{ font-size: 12px; color: var(--muted); line-height: 1.25; }

/* ---------- extras ---------- */
.extras{
  display: grid; gap:8px;
}
.extra-option{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  border:1px solid var(--border); border-radius: 10px; padding:10px 12px; background:#fff;
}
.extra-option input{ margin-right:8px; }
.extra-label{ display:flex; align-items:center; gap:8px; }
.extra-price{ color:#16a34a; font-weight:700; }

/* ---------- terms/checkbox row ---------- */
.payment-agreement{
  margin-top: 8px; font-size: 13px; color: var(--muted);
}
.payment-agreement a{ font-weight: 700; }

/* ---------- email field ---------- */
.email-input{ margin-top: 8px; }
.email-input label{ display:block; font-size: 13px; margin-bottom:6px; color: var(--muted); }
.email-input input{
  width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:10px;
  outline: none; font-size:14px; background:#fff;
}
.email-input input:focus{
  border-color: #e9d5ff; box-shadow: 0 0 0 4px #f3e8ff;
}

/* ---------- action button ---------- */
.action-button{
  width:100%; margin-top: 10px;
  background: var(--brand-gradient);
  color:#fff; border:none; border-radius: 12px; padding:12px 14px; font-weight:800;
  box-shadow: 0 10px 16px rgba(124,58,237,.22);
  cursor:pointer; transition: transform .05s ease, filter .15s ease;
  text-align:center; display:inline-flex; align-items:center; justify-content:center; gap:8px;
}
.action-button:hover{ filter: brightness(1.02); }
.action-button:active{ transform: translateY(1px); }

/* ---------- error box ---------- */
.error-container{
  display:none; margin-top:10px; padding:10px 12px; border:1px solid var(--error-border);
  background: var(--error-bg); color: var(--error-text); border-radius: 10px;
}
.error-title{ font-weight: 800; display:flex; align-items:center; gap:6px; margin-bottom:6px; }

/* ---------- post-payment progress + download ---------- */
#postPaySection{ margin-top: 14px; }
#downloadSection{ display:none; margin-top: 12px; }
#downloadLink{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 14px; border-radius: 12px; background: var(--success); color:#fff;
}
#downloadLink:hover{ filter: brightness(1.02); }

/* ---------- pricing card ---------- */
.info-card h2{
  margin: 0 0 10px; font-size: 16px; display:flex; align-items:center; gap:8px;
}
.pricing-table-wrapper{
  width:100%;
  overflow-x:auto;
}
.pricing-table{
  width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px;
  border:1px solid var(--border); border-radius: 10px; overflow: hidden; table-layout: fixed;
}
.pricing-table thead th{
  background: var(--brand-soft); color: var(--brand-700); padding: 8px; border-bottom:1px solid #eadcff; text-align:center;
}
.pricing-table th, .pricing-table td{
  padding: 8px; border-top:1px solid var(--border); text-align:center;
}
.pricing-table th:first-child, .pricing-table td:first-child{
  text-align:left;
}
.pricing-table tr:nth-child(even) td{ background:#fafaff; }

.pricing-table tfoot .emph th,
.pricing-table tfoot .emph td { font-weight: 700; }
.pricing-table [data-col].is-selected { background: #f1ecff; font-weight: 600; }
.pricing-table .sep-row td { border: 0; height: 8px; }

/* Mini-bill totals row emphasis */
#pricingTotals tbody tr td:first-child { font-weight: 600; color: #2d3748; }
#pricingTotals tbody tr td:not(:first-child) { font-weight: 600; }

.price-summary{
  border:1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.price-item, .price-total{
  display:flex; justify-content:space-between; padding:8px 10px; font-size: 13px; border-top:1px solid var(--border);
}
.price-item:first-child{ border-top: none; }
.price-total{
  font-weight: 800; background:#fbfbff;
}

/* ---------- utilities ---------- */
.hidden{ display:none !important; }

/* ---------- small tweaks for mobile ---------- */
@media (max-width: 540px){
  .providers{ grid-template-columns: 1fr; }
  .steps{ flex-wrap: wrap; }
}

/* =========================================================
   Enhancements (non‑breaking) – accessibility, animations,
   states, and sticky pricing card. All selectors reuse your
   existing structure so JS keeps working.
   ========================================================= */

/* Focus-visible rings for clickable widgets */
.providers .provider-card:focus-visible,
.upload-area:focus-visible,
.action-button:focus-visible,
.remove-file:focus-visible,
.email-input input:focus-visible{
  outline: none;
  box-shadow: var(--brand-ring);
  border-color: #e9d5ff;
}

/* Sticky pricing card on desktop */
@media (min-width: 981px){
  .info-card{ position: sticky; top: 20px; }
}

/* Progress “striped” feedback while active (disabled for reduced motion) */
.progress-container.is-active .progress-fill{
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.25), rgba(255,255,255,0)),
    var(--brand-gradient);
  background-size: 24px 100%, 100% 100%;
  background-repeat: repeat, no-repeat;
  animation: ms-stripes 1s linear infinite;
}
@keyframes ms-stripes{
  from{ background-position: 0 0, 0 0; }
  to  { background-position: 24px 0, 0 0; }
}
/* Completed progress state */
.progress-container.is-complete{
  border-color: #c7f0d2;
  background: #e8fff0;
}
.progress-container.is-complete .progress-fill{
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

/* Disable motion if user prefers reduced motion */
@media (prefers-reduced-motion: reduce){
  .progress-fill{ transition: none; animation: none !important; }
  .action-button{ transition: none; }
}

/* Button disabled / loading state (you can toggle [disabled]) */
.action-button[disabled]{
  opacity: .7;
  cursor: not-allowed;
  filter: grayscale(.15);
}

/* Subtle hover raise on cards/buttons */
.main-card, .info-card, .providers .provider-card, .upload-area{
  transition: transform .12s ease, box-shadow .2s ease;
}
.providers .provider-card:hover,
.upload-area:hover{ transform: translateY(-1px); }

/* Required email: show gentle invalid state */
.email-input input:required:invalid{
  border-color: #fbcfe8;
  box-shadow: 0 0 0 3px #fde7f3;
}
.email-input input:required:valid{
  border-color: #bbf7d0;
  box-shadow: 0 0 0 3px #e9ffe9;
}

/* Download success note styling */
#downloadSection .success-note{
  margin-top: 8px;
  font-size: 13px;
  color: #166534; /* deep green */
}

/* Small helper for screen-reader only text (a11y) */
.sr-only{
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
/* ---------- contact form ---------- */
.contact-form { padding: 8px; }
.form-row { margin-bottom: 12px; }
.form-row label {
  display:block; font-size: 13px; color: var(--muted); margin-bottom: 6px;
}
.form-row input[type="email"],
.form-row input[type="text"],
.form-row textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
  outline: none; font-size: 14px;
}
.form-row input:focus, .form-row textarea:focus {
  border-color: #e9d5ff; box-shadow: 0 0 0 4px #f3e8ff;
}
.form-note { margin-top: 8px; font-size: 12px; color: var(--muted); }

.success-box{
  margin: 8px 0 14px; padding: 10px 12px;
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46;
  border-radius: 10px; font-size: 14px;
}
/* ---- blog styles (lightweight; non-intrusive) ---- */
.blog-card{
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.blog-card__title{ margin: 0 0 6px; font-size: 18px; }
.blog-card__meta{ color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.blog-card__excerpt{ color: var(--text); margin-bottom: 10px; }

.blog-post__title{ margin:0 0 6px; }
.blog-post__meta{ color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.blog-post__body hr{ border:0; border-top:1px solid var(--border); margin:16px 0; }
.blog-post ul, .blog-post ol{ margin: 6px 0 12px 20px; }
