/* ================================================================
   StraightResume — responsive.css  (Production-Ready v3.0)
   ALL screen sizes: 320px → 4K (3840px)
   Mobile First + Progressive Enhancement
================================================================ */

/* ── GLOBAL BOX MODEL FIX ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }

/* ── 4K / ULTRA-WIDE (2560px+) ───────────────────────────────── */
@media (min-width: 2560px) {
  html { font-size: 18px; }
  .container { max-width: 1600px; }
  .form-page { max-width: 1200px; padding: 56px 48px 120px; }
  .templates-page { max-width: 1500px; padding: 64px 48px 120px; }
  .preview-page { max-width: 1600px; padding: 40px 48px; }
  .preview-paper { max-width: 1100px; padding: 48px; font-size: 16px; }
  .progress-bar-wrap { top: 80px; }
  .progress-steps { max-width: 1100px; }
  .ps { font-size: .9rem; padding: 22px 12px; }
  .nav { height: 90px; }
  .nav-inner { max-width: 1560px; }
  .templates-grid { grid-template-columns: repeat(4, 1fr); gap: 36px; }
  .template-preview { height: 480px; }
  .section-header h2 { font-size: 1.8rem; }
  .section-icon { width: 68px; height: 68px; font-size: 1.8rem; border-radius: 18px; }
  .field-group label { font-size: 1rem; }
  .field-group input, .field-group select, .field-group textarea {
    padding: 14px 18px; font-size: 1.05rem; border-radius: 14px;
  }
  .dynamic-card { padding: 32px 36px; border-radius: 20px; }
  .payment-card { max-width: 700px; padding: 60px; }
  .add-btn { padding: 16px 28px; font-size: 1.05rem; }
  .add-btn-sm { padding: 12px 20px; font-size: .95rem; }
  .extras-block { padding: 28px 32px; }
  .extras-block h3 { font-size: 1.1rem; }
  .form-nav { padding: 20px 48px; }
  .btn.btn-primary, .btn.btn-ghost { padding: 16px 36px; font-size: 1.05rem; }
  .fields-grid.cols-2 { grid-template-columns: 1fr 1fr; gap: 28px; }
  .fields-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; gap: 28px; }
  .template-cta { padding: 28px 40px; }
  .download-cta-bar { padding: 28px 40px; }
}

/* ── QHD / 1440p (1920px–2559px) ─────────────────────────────── */
@media (min-width: 1920px) and (max-width: 2559px) {
  html { font-size: 17px; }
  .container { max-width: 1400px; }
  .form-page { max-width: 1060px; padding: 44px 40px 100px; }
  .templates-page { max-width: 1360px; padding: 52px 40px 100px; }
  .preview-paper { max-width: 980px; padding: 40px; font-size: 15px; }
  .templates-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .template-preview { height: 440px; }
  .nav { height: 80px; }
  .progress-bar-wrap { top: 80px; }
  .fields-grid.cols-2 { grid-template-columns: 1fr 1fr; gap: 24px; }
  .fields-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
  .section-header h2 { font-size: 1.6rem; }
  .section-icon { width: 60px; height: 60px; font-size: 1.6rem; }
  .dynamic-card { padding: 28px 30px; }
  .payment-card { max-width: 600px; padding: 50px; }
}

/* ── FULL HD (1440px–1919px) ──────────────────────────────────── */
@media (min-width: 1440px) and (max-width: 1919px) {
  .container { max-width: 1300px; }
  .form-page { max-width: 960px; padding: 40px 36px 90px; }
  .templates-page { max-width: 1240px; }
  .preview-paper { max-width: 920px; padding: 36px; }
  .templates-grid { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .template-preview { height: 400px; }
  .fields-grid.cols-2 { grid-template-columns: 1fr 1fr; gap: 22px; }
  .fields-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; gap: 22px; }
}

/* ── LAPTOP / DESKTOP (1200px–1439px) ────────────────────────── */
@media (min-width: 1200px) and (max-width: 1439px) {
  .container { max-width: 1160px; }
  .form-page { max-width: 900px; padding: 36px 32px 90px; }
  .templates-page { max-width: 1100px; }
  .templates-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .template-preview { height: 370px; }
  .fields-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .fields-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── SMALL LAPTOP (1025px–1199px) ────────────────────────────── */
@media (min-width: 1025px) and (max-width: 1199px) {
  .container { max-width: 1000px; }
  .form-page { max-width: 860px; padding: 32px 28px 80px; }
  .templates-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .template-preview { height: 340px; }
  .fields-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .fields-grid.cols-3 { grid-template-columns: 1fr 1fr; }
}

/* ── TABLET LANDSCAPE (769px–1024px) ─────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .container { max-width: 960px; }
  html { font-size: 15.5px; }

  /* Nav */
  .nav { height: 64px; }
  .nav-inner { padding: 0 20px; }
  .progress-bar-wrap { top: 64px; }

  /* Form */
  .form-page { max-width: 100%; padding: 24px 20px 80px; }
  .fields-grid.cols-2 { grid-template-columns: 1fr 1fr; gap: 16px; }
  .fields-grid.cols-3 { grid-template-columns: 1fr 1fr; gap: 16px; }

  /* Progress */
  .ps { font-size: .72rem; padding: 14px 6px; }

  /* Section header */
  .section-header { padding: 18px 20px; gap: 14px; }
  .section-header h2 { font-size: 1.25rem; }
  .section-icon { width: 48px; height: 48px; font-size: 1.25rem; }

  /* Dynamic cards */
  .dynamic-card { padding: 20px; }
  .dynamic-card.compact { padding: 16px; }

  /* Template grid */
  .templates-page { padding: 36px 20px 80px; }
  .templates-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .template-preview { height: 300px; }
  .template-cta { flex-wrap: wrap; gap: 14px; }

  /* Payment */
  .payment-card { padding: 36px 28px; }
  .payment-features { grid-template-columns: 1fr 1fr; }

  /* Preview */
  .preview-page { padding: 16px; }
  .preview-toolbar { flex-wrap: wrap; gap: 10px; }
  .preview-paper { padding: 20px; font-size: 13px; }
}

/* ── TABLET PORTRAIT (601px–768px) ───────────────────────────── */
@media (max-width: 768px) {
  html { font-size: 15px; }

  /* ── NAV ── */
  .nav { height: 62px; }
  .nav-inner { padding: 0 16px; }
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed; top: 62px; left: 0; right: 0;
    background: white; flex-direction: column;
    padding: 14px 16px; gap: 4px;
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    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: 11px 14px; border-radius: 10px; font-size: .92rem; }
  .nav-cta { text-align: center; }

  /* ── PROGRESS BAR ── */
  .progress-bar-wrap {
    top: 62px; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .progress-steps { min-width: 480px; gap: 0; padding: 0 10px; }
  .ps { font-size: .65rem; padding: 10px 4px; letter-spacing: 0; }
  .ps.done::after { display: none; }

  /* ── FORM PAGE ── */
  .form-page { padding: 20px 16px 100px; max-width: 100%; }

  /* ── FIELD GRIDS — all single col on mobile ── */
  .fields-grid.cols-2,
  .fields-grid.cols-3 { grid-template-columns: 1fr; gap: 14px; }

  /* Inputs — bigger tap targets, prevent iOS zoom */
  .field-group input,
  .field-group select,
  .field-group textarea {
    font-size: 16px !important; /* iOS zoom prevention */
    padding: 11px 13px;
    min-height: 46px;
  }
  .field-group label { font-size: .8rem; }
  .field-group textarea { min-height: 90px; }

  /* ── SECTION HEADER ── */
  .section-header {
    padding: 15px 16px; gap: 12px;
    margin-bottom: 24px; border-radius: 12px;
  }
  .section-icon { width: 44px; height: 44px; font-size: 1.15rem; border-radius: 12px; flex-shrink: 0; }
  .section-header h2 { font-size: 1.15rem; }
  .section-header p { font-size: .8rem; }

  /* ── PHOTO UPLOAD ── */
  .photo-upload-area { margin-bottom: 18px; }

  /* ── DYNAMIC CARDS ── */
  .dynamic-card { padding: 16px 14px; border-radius: 12px; margin-bottom: 12px; }
  .dynamic-card.compact { padding: 13px 12px; }
  .card-handle { display: none; }
  .remove-btn { top: 10px; right: 10px; width: 30px; height: 30px; font-size: .78rem; border-radius: 7px; }

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

  /* ── EXTRAS BLOCK ── */
  .extras-block { padding: 15px 14px; margin-bottom: 22px; border-radius: 12px; }
  .extras-block h3 { font-size: .86rem; margin-bottom: 12px; }

  /* ── SUBSECTION DIVIDER ── */
  .subsection-divider { font-size: .82rem; margin: 20px 0 16px; }

  /* ── FORM NAV ── */
  .form-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    padding: 12px 16px; margin: 0; z-index: 200;
    gap: 10px; border-radius: 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.12);
  }
  .btn.btn-primary { padding: 12px 20px; font-size: .9rem; }
  .btn.btn-ghost { padding: 12px 16px; font-size: .9rem; }
  #btnNext, #btnSubmit { margin-left: auto; }

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

  /* ── TEMPLATES ── */
  .templates-page { padding: 28px 16px 80px; }
  .templates-grid { grid-template-columns: 1fr; gap: 16px; }
  .template-preview { height: 200px; }
  .template-card:hover { transform: none; }
  .template-info { padding: 14px 12px; }
  .template-info h3 { font-size: .93rem; }
  .template-info p { font-size: .78rem; }
  .template-tags span { font-size: .68rem; padding: 3px 8px; }
  .template-cta { flex-direction: column; text-align: center; gap: 12px; padding: 16px; }
  .btn-xl { width: 100%; justify-content: center; padding: 12px 20px; }
  .selected-info { justify-content: center; }

  /* ── PAYMENT ── */
  .payment-page { padding: 20px 14px; min-height: auto; align-items: flex-start; }
  .payment-card { padding: 28px 20px; max-width: 100%; border-radius: 20px; }
  .payment-header h1 { font-size: 1.4rem; }
  .payment-features { grid-template-columns: 1fr; gap: 6px; }
  .order-item { gap: 10px; }
  .order-total strong { font-size: 1.35rem; }

  /* ── PREVIEW ── */
  .preview-page { padding: 12px; }
  .preview-toolbar {
    flex-direction: column; align-items: stretch;
    gap: 10px; padding: 12px 14px;
  }
  .toolbar-left, .toolbar-right { width: 100%; justify-content: center; flex-wrap: wrap; }
  .preview-container { padding: 10px 0; }
  .preview-paper { padding: 14px; font-size: 12px; line-height: 1.5; }
  .download-cta-bar { flex-direction: column; padding: 16px; gap: 12px; text-align: center; }
  .cta-left { justify-content: center; }
  .btn-download { width: 100%; justify-content: center; }

  /* ── HERO & GENERAL ── */
  .hero { padding: 64px 16px 72px; }
  .hero h1 { font-size: 2rem; letter-spacing: -0.5px; }
  .hero p { font-size: 1rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; max-width: 300px; justify-content: center; }
  .hero-trust { gap: 16px; flex-wrap: wrap; }
  .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  section { padding: 52px 16px; }
  section h2, .section-title { font-size: 1.7rem; }
}

/* ── MOBILE PORTRAIT (max 600px) ─────────────────────────────── */
@media (max-width: 600px) {
  .templates-grid { grid-template-columns: 1fr; }
  .fields-grid { gap: 12px; }
  .form-page { padding: 16px 14px 100px; }
  .template-preview { height: 180px; }
}

/* ── SMALL MOBILE (max 480px) ─────────────────────────────────── */
@media (max-width: 480px) {
  html { font-size: 14.5px; }

  .container { padding: 0 12px; }

  /* Nav */
  .nav { height: 56px; }
  .nav-inner { padding: 0 14px; }
  .progress-bar-wrap { top: 56px; }
  .main-logo { height: 65px; }

  /* Hero */
  .hero { padding: 52px 14px 60px; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: .95rem; }

  /* Form */
  .form-page { padding: 14px 12px 100px; }
  .fields-grid { gap: 11px; }
  .field-group input,
  .field-group select,
  .field-group textarea { padding: 10px 12px; }
  .field-group label { font-size: .78rem; }

  /* Section header */
  .section-header { padding: 13px 14px; gap: 10px; margin-bottom: 20px; }
  .section-icon { width: 40px; height: 40px; font-size: 1rem; border-radius: 10px; }
  .section-header h2 { font-size: 1.05rem; }
  .section-header p { font-size: .76rem; }

  /* Dynamic card */
  .dynamic-card { padding: 13px 12px; }
  .dynamic-card.compact { padding: 11px 10px; }
  .remove-btn { width: 28px; height: 28px; top: 8px; right: 8px; }

  /* Buttons */
  .add-btn { font-size: .82rem; padding: 10px 14px; }
  .add-btn-sm { font-size: .75rem; padding: 7px 10px; }
  .btn.btn-primary { padding: 11px 18px; font-size: .88rem; }
  .btn.btn-ghost { padding: 11px 14px; font-size: .88rem; }
  .form-nav { padding: 10px 14px; }

  /* Extras */
  .extras-block { padding: 13px 12px; margin-bottom: 18px; }
  .extras-block h3 { font-size: .82rem; }

  /* Progress bar */
  .progress-steps { min-width: 420px; }
  .ps { font-size: .6rem; padding: 9px 3px; }

  /* Photo */
  .photo-placeholder { width: 86px; height: 86px; }

  /* Templates */
  .templates-page { padding: 20px 12px 70px; }
  .page-header h1 { font-size: 1.4rem; }
  .page-header p { font-size: .85rem; }
  .template-preview { height: 160px; padding: 6px; }
  .template-info { padding: 12px 10px; }
  .template-info h3 { font-size: .88rem; }
  .template-info p { font-size: .74rem; }
  .template-tags span { font-size: .65rem; padding: 2px 7px; }

  /* Payment */
  .payment-page { padding: 14px 10px; }
  .payment-card { padding: 22px 16px; border-radius: 16px; }
  .payment-lock { width: 50px; height: 50px; font-size: 1.2rem; }
  .payment-header h1 { font-size: 1.25rem; }
  .order-summary { padding: 14px 12px; }
  .order-item-price { font-size: 1.1rem; }
  .payment-features { gap: 5px; }
  .pf-item { font-size: .76rem; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; }
  section h2, .section-title { font-size: 1.5rem; }
  .btn-lg { padding: 12px 20px; font-size: .92rem; }
}

/* ── VERY SMALL (max 360px) ───────────────────────────────────── */
@media (max-width: 360px) {
  html { font-size: 14px; }
  .container { padding: 0 10px; }

  /* Nav */
  .nav { height: 54px; }
  .progress-bar-wrap { top: 54px; }
  .progress-steps { min-width: 380px; }
  .ps { font-size: .56rem; padding: 8px 2px; }

  /* Form */
  .form-page { padding: 12px 10px 100px; }
  .section-header { padding: 11px 12px; }
  .section-icon { width: 36px; height: 36px; font-size: .9rem; border-radius: 8px; }
  .section-header h2 { font-size: 1rem; }
  .dynamic-card { padding: 11px 10px; }
  .remove-btn { width: 26px; height: 26px; font-size: .7rem; }

  /* Buttons */
  .btn.btn-primary { padding: 10px 14px; font-size: .84rem; }
  .btn.btn-ghost { padding: 10px 12px; font-size: .84rem; }
  .form-nav { padding: 9px 12px; }
  .add-btn { font-size: .78rem; padding: 9px 12px; }
  .add-btn-sm { font-size: .72rem; padding: 6px 9px; }

  /* Templates */
  .template-preview { height: 140px; padding: 4px; }
  .template-info { padding: 10px 8px; }
  .template-info h3 { font-size: .84rem; }

  /* Payment */
  .payment-card { padding: 18px 13px; }
  .payment-header h1 { font-size: 1.15rem; }

  /* Form nav wrap */
  .form-nav { flex-wrap: wrap; }
  .form-nav .btn { flex: 1; justify-content: center; min-width: 100px; }

  section h2 { font-size: 1.3rem; }
  .hero h1 { font-size: 1.55rem; }
}

/* ── LANDSCAPE PHONE (orientation fix) ───────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .progress-bar-wrap { position: relative; top: 0; }
  .form-nav { position: relative; margin: 16px 0 0; box-shadow: none; border-top: 1px solid #e2e8f0; }
  .form-page { padding-bottom: 40px; }
}

/* ── PRINT / PDF EXPORT ───────────────────────────────────────── */
@media print {
  .nav, .footer, .progress-bar-wrap, .form-nav,
  .preview-toolbar, .download-cta-bar,
  .template-cta, .payment-page { display: none !important; }
  .preview-paper {
    border: none !important; box-shadow: none !important;
    padding: 0 !important; margin: 0 !important;
    max-width: 100% !important; min-height: auto !important;
  }
  body { background: white !important; }
  .preview-page { padding: 0 !important; }
  .preview-container { padding: 0 !important; overflow: visible !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
