/* ================================================================
   StraightResume — Responsive Breakpoints (UPDATED)
   All screen sizes: Desktop → Tablet → Mobile → Small Mobile
================================================================ */

/* ── LARGE DESKTOP (1400px+) ──────────────────────────────────── */
@media (min-width: 1400px) {
  .container { max-width: 1280px; }
  .form-page { max-width: 960px; }
  .templates-page { max-width: 1100px; }
}

/* ── DESKTOP (1025px – 1199px) ────────────────────────────────── */
@media (max-width: 1199px) {
  .templates-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── TABLET LANDSCAPE (1024px) ────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .templates-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .form-page { max-width: 100%; padding: 28px 20px 80px; }
  .fields-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .preview-toolbar { flex-wrap: wrap; gap: 12px; }
  .toolbar-left, .toolbar-right { flex-wrap: wrap; }
  .download-cta-bar { flex-wrap: wrap; gap: 16px; }
}

/* ── TABLET PORTRAIT (768px – 1024px) ─────────────────────────── */
@media (max-width: 768px) {
  /* Global */
  section { padding: 56px 20px; }
  html { font-size: 15px; }

  /* Nav */
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed; top: 70px; left: 0; right: 0;
    background: white; flex-direction: column;
    padding: 16px; gap: 4px;
    box-shadow: 0 12px 40px rgba(0,0,0,.1);
    border-bottom: 1px solid #e2e8f0;
    transform: translateY(-100%); opacity: 0;
    pointer-events: none; transition: all .3s ease; z-index: 999;
  }
  .nav-menu.open { transform: translateY(0); opacity: 1; pointer-events: all; }
  .nav-menu li { width: 100%; }
  .nav-menu li a { display: block; padding: 12px 16px; border-radius: 10px; }
  .nav-cta { text-align: center; }

  /* Hero */
  .hero { padding: 72px 20px 80px; }
  .hero h1 { font-size: 2rem; letter-spacing: -1px; }
  .hero-trust { gap: 16px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn,
  .hero-actions .cta-button { width: 100%; max-width: 320px; justify-content: center; }

  /* Grids */
  .grid-cols-3,
  .grid-cols-2 { grid-template-columns: 1fr; }

  /* Pricing */
  .pricing-box.featured { transform: scale(1); }
  .pricing-box.featured:hover { transform: translateY(-6px); }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom-links { flex-wrap: wrap; justify-content: center; gap: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  section h2, .section-title { font-size: 1.7rem; }
  .page-hero h1 { font-size: 1.8rem; }

  /* ── FORM (Builder) ──────────────────────── */
  .fields-grid.cols-2,
  .fields-grid.cols-3 { grid-template-columns: 1fr; }

  .form-page { padding: 14px 14px 80px; }

  .progress-bar-wrap { top: 60px; }
  .progress-steps { gap: 0; padding: 0 12px; }
  .ps { font-size: .65rem; padding: 10px 3px; letter-spacing: 0; }
  .ps.done::after { display: none; }

  .section-header {
    padding: 16px 18px; gap: 12px; flex-wrap: wrap;
    border-radius: 12px; margin-bottom: 24px;
  }
  .section-icon { width: 44px; height: 44px; font-size: 1.2rem; border-radius: 12px; }
  .section-header h2 { font-size: 1.2rem; }
  .section-header p { font-size: .82rem; }

  /* Photo upload – center on mobile */
  .photo-upload-area { margin-bottom: 20px; }

  /* Dynamic cards */
  .dynamic-card { padding: 16px 14px; border-radius: 12px; }
  .dynamic-card.compact { padding: 14px 12px; }
  .card-handle { display: none; } /* hide drag handle on touch */
  .remove-btn { top: 10px; right: 10px; width: 28px; height: 28px; font-size: .78rem; }

  /* Add buttons */
  .add-btn { padding: 11px 16px; font-size: .85rem; }
  .add-btn-sm { padding: 8px 12px; font-size: .78rem; }

  /* Extras block */
  .extras-block { padding: 16px 14px; }
  .extras-block h3 { font-size: .88rem; }

  /* Form nav (sticky bottom bar) */
  .form-nav {
    padding: 10px 12px;
    margin: 0 -12px -72px;
    gap: 8px;
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.95));
    box-shadow: 0 -6px 18px rgba(16,24,40,0.04);
  }
  .btn.btn-primary { padding: 11px 20px; font-size: .88rem; }
  .btn.btn-ghost  { padding: 11px 18px; font-size: .88rem; }

  /* Lang selector */
  .lang-selector-row { padding: 12px 14px; gap: 8px; flex-wrap: wrap; }
  .lang-select { max-width: 100%; }

  /* Template page */
  .templates-grid { grid-template-columns: 1fr; }
  .template-cta { flex-direction: column; text-align: center; }
  .template-preview { height: 160px; }

  /* Payment */
  .payment-features { grid-template-columns: 1fr; }
  .payment-card { padding: 24px 18px; }
  .payment-page { padding: 24px 16px; }

  /* Preview page */
  .preview-toolbar {
    flex-direction: column; align-items: stretch; gap: 10px;
    padding: 14px 16px;
  }
  .toolbar-left,
  .toolbar-right { justify-content: center; flex-wrap: wrap; }
  .preview-paper { padding: 12px; }
  .download-cta-bar { flex-direction: column; padding: 18px 20px; gap: 14px; }
}

/* ── SMALL MOBILE (481px – 575px) ─────────────────────────────── */
@media (max-width: 575px) {
  .container { padding: 0 14px; }
  .hero h1 { font-size: 1.8rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .section-header { flex-direction: row; align-items: flex-start; }
  .form-page { padding: 16px 12px 80px; }
  .fields-grid { gap: 14px; }
  .field-group input,
  .field-group select,
  .field-group textarea { padding: 10px 12px; font-size: .88rem; }
  .form-nav { padding: 10px 12px; margin: 0 -12px -80px; }
}

/* ── EXTRA SMALL (≤ 480px) ────────────────────────────────────── */
@media (max-width: 480px) {
  html { font-size: 14px; }
  .container { padding: 0 12px; }
  .hero h1 { font-size: 1.65rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-box { padding: 1.5rem; }
  .card { padding: 1.25rem; }
  .btn-lg { padding: 13px 20px; font-size: .95rem; }
  section h2 { font-size: 1.45rem; }
  .footer-grid { gap: 20px; }

  /* Form */
  .dynamic-card { padding: 14px 12px; }
  .progress-steps { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ps { min-width: 60px; font-size: .6rem; }

  /* Nav fix */
  .nav { height: 60px; }
  .nav-inner { padding: 0 14px; }

  /* Template preview smaller */
  .template-preview { height: 130px; }
  .template-info { padding: 14px; }
  .template-info h3 { font-size: .95rem; }
  .template-info p { font-size: .78rem; }
}

/* ── LANDSCAPE PHONE fix ───────────────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .progress-bar-wrap { position: relative; top: 0; }
  .form-nav { position: relative; margin: 16px 0 0; }
}

/* ================================================================
   v7 polish — logo sizing, ultra-small screens, a11y
   (color palette unchanged; layout/scale + accessibility only)
================================================================ */

/* ── Responsive logo (fits the 70px nav cleanly at every width) ── */
@media (max-width: 768px) {
  .main-logo { height: 38px; }
}
@media (max-width: 480px) {
  .main-logo { height: 34px; }
  .nav .nav-inner,
  nav .container { padding-left: 14px; padding-right: 14px; }
}

/* ── ULTRA-SMALL (≤ 360px) — prevent overflow on tiny phones ───── */
@media (max-width: 360px) {
  html { font-size: 13.5px; }
  .container { padding: 0 10px; }
  .hero h1 { font-size: 1.5rem; letter-spacing: -.5px; }
  .hero p { font-size: .95rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .btn, .button, .cta-button { width: 100%; justify-content: center; }
  .hero-actions { width: 100%; }
  .price { font-size: 2.4rem; }
  .ps { min-width: 56px; font-size: .56rem; }
  .section-header { padding: 14px; gap: 10px; }
  .section-header h2 { font-size: 1.1rem; }
  .form-page { padding: 12px 10px 80px; }
}

/* ── Touch targets: comfortable tap size on coarse pointers ────── */
@media (pointer: coarse) {
  .nav-menu li a,
  .footer-bottom-links a,
  .add-btn,
  .remove-btn,
  .faq-question { min-height: 44px; }
}

/* ── Keyboard focus visibility (a11y) ──────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.template-card:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--b400, #60a5fa);
  outline-offset: 2px;
}

/* ── Respect reduced-motion preference (a11y) ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .animate-up { opacity: 1 !important; transform: none !important; }
}
