/* ==========================================================================
   UK CV ATS Scanner — Main Styles (index.html)
   Mobile-first, responsive, vanilla CSS
   ========================================================================== */

/* --------------------------------------------------------------------------
   Google Fonts
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* --------------------------------------------------------------------------
   Custom properties
   -------------------------------------------------------------------------- */
:root {
  /* --- FreeNexGenTools brand --- */
  --brand-navy:        #0D1B2A;
  --brand-navy-hover:  #1A2F45;
  --brand-teal:        #00C9A7;
  --brand-teal-dark:   #009E85;
  --brand-teal-light:  #E6FAF7;

  /* --- CheckMyCV tool accent --- */
  --primary:           #4F46E5;
  --primary-dark:      #3730A3;
  --primary-light:     #EEF2FF;

  --secondary:         #0F9B6E;
  --danger:            #DC2626;
  --warning:           #D97706;
  --bg:                #F0F4FF;
  --surface:           #FFFFFF;
  --border:            #E2E8F0;
  --text-primary:      #0F172A;
  --text-secondary:    #475569;
  --text-muted:        #94A3B8;

  --radius-sm:         6px;
  --radius-md:         12px;
  --radius-lg:         20px;

  --shadow-sm:         0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:         0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg:         0 10px 30px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.06);

  --transition:        0.2s ease;
  --font-heading:      'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:         'Inter', system-ui, sans-serif;

  --max-width:         860px;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 3px;
}

ul {
  list-style: none;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--brand-navy);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
  flex-wrap: wrap;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: #fff;
}

.site-logo:hover {
  text-decoration: none;
  color: var(--brand-teal);
}
  color: var(--primary);
}

.logo-img {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1.2;
  color: #fff;
}

.logo-tld {
  color: var(--brand-teal);
}

.logo-sub {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.01em;
}

/* Tool navigation pills in header */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tool-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: all var(--transition);
  cursor: default;
}

a.tool-nav-pill {
  cursor: pointer;
}

a.tool-nav-pill:hover,
a.tool-nav-pill.active {
  background: var(--brand-teal);
  border-color: var(--brand-teal);
  color: #0D1B2A;
  text-decoration: none;
}

.tool-nav-pill.coming-soon {
  opacity: 0.5;
}

.tool-nav-pill em {
  font-style: normal;
  font-size: 0.7rem;
  background: rgba(255,255,255,0.15);
  border-radius: 99px;
  padding: 0.05rem 0.4rem;
  margin-left: 0.2rem;
}

/* --------------------------------------------------------------------------
   Tool context bar (breadcrumb + tool badge)
   -------------------------------------------------------------------------- */
.tool-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding-block: 0.5rem;
}

.tool-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tool-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0;
  margin: 0;
}

.tool-breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.tool-breadcrumb a:hover {
  text-decoration: underline;
}

.tool-breadcrumb li:last-child {
  font-weight: 600;
  color: var(--text-secondary);
}

.tool-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(79,70,229,0.2);
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  text-decoration: none;
  transition: all var(--transition);
}

a.tool-badge-pill:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Hero section
   -------------------------------------------------------------------------- */
.hero {
  padding-block: 2.75rem 2.25rem;
  text-align: center;
  background: linear-gradient(160deg, #F0F4FF 0%, #EEF2FF 100%);
  border-bottom: 1px solid #DDE3FF;
}

/* Tool label above H1 */
.hero-tool-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(79,70,229,0.25);
  padding: 0.35rem 1rem;
  border-radius: 99px;
  margin-bottom: 1.25rem;
}

.tool-icon-lg {
  font-size: 1rem;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: 2rem;
  line-height: 1.65;
}

/* Trust badges */
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
  margin-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.375rem 0.75rem;
  border-radius: 99px;
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Upload form card
   -------------------------------------------------------------------------- */
.upload-section {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.upload-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
  position: relative;
  margin-bottom: 1.5rem;
  outline: none;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.drop-zone:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 79, 216, 0.2);
}

.drop-zone input[type="file"] {
  display: none;
}

.drop-zone-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  margin-bottom: 1rem;
  color: var(--primary);
  font-size: 1.5rem;
}

.drop-zone-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.drop-zone-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.drop-zone-subtitle strong {
  color: var(--primary);
}

/* File selected state */
.drop-zone.file-selected {
  border-style: solid;
  border-color: var(--secondary);
  background-color: #F0FDF4;
}

.file-selected-info {
  display: none;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
}

.drop-zone.file-selected .drop-zone-default {
  display: none;
}

.drop-zone.file-selected .file-selected-info {
  display: flex;
}

.file-icon {
  font-size: 2rem;
  line-height: 1;
}

.file-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.file-size {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.remove-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
  z-index: 1;
  position: relative;
}

.remove-file-btn:hover {
  background: rgba(220, 38, 38, 0.2);
}

/* Job description header: label + tabs */
.jd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.jd-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
}

.jd-tab {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.jd-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.jd-tab:hover:not(.active) {
  color: var(--text-primary);
}

/* URL input row */
.jd-url-wrapper {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.jd-url-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.jd-url-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
  background: var(--surface);
}

.btn-fetch-url {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity var(--transition);
  white-space: nowrap;
}

.btn-fetch-url:hover:not(:disabled) {
  opacity: 0.88;
}

.btn-fetch-url:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fetch-status {
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
  min-height: 1.2em;
}

.fetch-status.success { color: var(--secondary); }
.fetch-status.error   { color: var(--danger); }

/* Job description textarea */
.field-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.field-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.jd-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.jd-textarea {
  width: 100%;
  min-height: 180px;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.6;
}

.jd-textarea::placeholder {
  color: var(--text-muted);
}

.jd-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 79, 216, 0.15);
  background: var(--surface);
}

.char-counter {
  position: absolute;
  bottom: 0.625rem;
  right: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.char-counter.near-limit {
  color: var(--warning);
}

.char-counter.at-limit {
  color: var(--danger);
}

/* Submit button */
.btn-scan {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--primary) 100%);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.4);
  letter-spacing: 0.01em;
}

.btn-scan:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(79, 70, 229, 0.5);
}

.btn-scan:active:not(:disabled) {
  transform: translateY(0);
}

.btn-scan:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-scan:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error message */
.error-message {
  display: none;
  align-items: flex-start;
  gap: 0.625rem;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: #991B1B;
}

.error-message.visible {
  display: flex;
}

.error-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   How it works section
   -------------------------------------------------------------------------- */
.how-it-works {
  padding-block: 3.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.375rem, 4vw, 1.875rem);
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2.5rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.step-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.375rem;
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--brand-navy);
  color: var(--brand-teal);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.125rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--brand-teal);
}

.step-body h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.step-body p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   FAQ section
   -------------------------------------------------------------------------- */
.faq-section {
  padding-block: 3.5rem;
}

.faq-list {
  max-width: 720px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

details.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

details.faq-item[open] {
  box-shadow: var(--shadow-sm);
}

summary.faq-question {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 1.125rem 1.25rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: background var(--transition);
  user-select: none;
}

summary.faq-question::-webkit-details-marker {
  display: none;
}

summary.faq-question::after {
  content: '+';
  flex-shrink: 0;
  font-size: 1.375rem;
  font-weight: 400;
  color: var(--primary);
  line-height: 1;
  transition: transform var(--transition);
}

details.faq-item[open] summary.faq-question::after {
  transform: rotate(45deg);
}

summary.faq-question:hover {
  background: var(--bg);
}

summary.faq-question:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.faq-answer p + p {
  margin-top: 0.625rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background: var(--brand-navy);
  color: rgba(255,255,255,0.55);
  padding-block: 2.5rem;
  font-size: 0.875rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
  }
}

/* Brand column */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
}

.footer-logo:hover {
  color: var(--brand-teal);
  text-decoration: none;
}

.footer-tld {
  color: var(--brand-teal);
}

.footer-tagline {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  max-width: 220px;
}

/* Tools column */
.footer-tools {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-tools-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.footer-tools nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-tool-link {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color var(--transition);
}

a.footer-tool-link:hover {
  color: var(--brand-teal);
  text-decoration: none;
}

a.footer-tool-link.active {
  color: var(--brand-teal);
  font-weight: 600;
}

.footer-tool-link.muted {
  color: rgba(255,255,255,0.3);
  font-size: 0.8125rem;
}

.footer-tool-link.muted em {
  font-style: normal;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Legal column */
.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.footer-links a {
  color: rgba(255,255,255,0.55);
  font-size: 0.8125rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-privacy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
  line-height: 1.5;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.25);
}

/* AdSense — rectangle sidebar (hidden on mobile) */
.ad-sidebar {
  display: none;
}

/* --------------------------------------------------------------------------
   Sidebar layout on wide screens
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .page-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
    max-width: 1160px;
    margin-inline: auto;
    padding-inline: 1.25rem;
  }

  .ad-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 80px;
  }

  .ad-sidebar-unit {
    width: 300px;
    min-height: 250px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
  }
}

/* --------------------------------------------------------------------------
   Steps grid responsive
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .step-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Upload card wider padding on desktop
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .upload-card {
    padding: 2.5rem;
  }

  .btn-scan {
    width: auto;
    min-width: 260px;
    margin-inline: auto;
    display: inline-flex;
  }

  .btn-scan-wrapper {
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Print styles (not relevant for index.html but kept for completeness)
   -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .ad-footer,
  .ad-sidebar {
    display: none !important;
  }
}

/* ==========================================================================
   Responsive — Mobile & Tablet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Mobile: ≤ 639px
   -------------------------------------------------------------------------- */
@media (max-width: 639px) {
  /* Header: stack logo + nav on small screens */
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-block: 0.75rem;
  }

  /* Hide "Coming Soon" pills to save header space */
  .tool-nav-pill.coming-soon {
    display: none;
  }

  /* Tool bar: hide badge pill, let breadcrumb span full width */
  .tool-badge-pill {
    display: none;
  }

  /* Hero: tighter padding on mobile */
  .hero {
    padding-block: 1.75rem 1.5rem;
  }

  /* Upload section: tighter spacing */
  .upload-section {
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  /* Upload card: reduce padding */
  .upload-card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  /* Drop zone: reduce inner padding */
  .drop-zone {
    padding: 1.75rem 1rem;
  }

  /* JD header: stack label + tabs vertically */
  .jd-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* JD URL row: stack input + button vertically */
  .jd-url-wrapper {
    flex-direction: column;
  }

  .btn-fetch-url {
    width: 100%;
    justify-content: center;
  }

  /* Scan button: always full-width on mobile */
  .btn-scan {
    width: 100% !important;
    min-width: unset !important;
    font-size: 1rem;
  }

  /* "How it works" section: reduce padding */
  .how-it-works {
    padding-block: 2rem;
  }

  /* FAQ section: reduce padding */
  .faq-section {
    padding-block: 2rem;
  }

  /* Step cards: align icon left, text left */
  .step-card {
    flex-direction: row !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  /* Trust badges: smaller gap + font */
  .trust-badges {
    gap: 0.5rem;
  }

  .badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.625rem;
  }

  /* Footer: single column, centre-aligned on mobile */
  .footer-inner {
    text-align: center;
  }

  .footer-tagline {
    max-width: 100%;
  }

  .footer-links {
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Tablet: 640px – 767px  (before the footer 3-col kicks in at 768px)
   -------------------------------------------------------------------------- */
@media (min-width: 640px) and (max-width: 767px) {
  /* Upload section: moderate spacing */
  .upload-section {
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
  }

  /* Badge pill visible again on tablet */
  .tool-badge-pill {
    display: inline-flex;
  }
}

/* --------------------------------------------------------------------------
   Touch-friendly hit targets on mobile/tablet
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  /* Larger tap targets for interactive elements */
  .jd-tab {
    padding: 0.45rem 0.9rem;
    min-height: 36px;
  }

  summary.faq-question {
    padding: 1.25rem;
  }

  .remove-file-btn {
    width: 36px;
    height: 36px;
    font-size: 1.125rem;
  }
}

/* --------------------------------------------------------------------------
   Cookie consent banner
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #1e293b;
  color: #f1f5f9;
  border-top: 2px solid #3b82f6;
  padding: 1rem 1.25rem;
}

.cookie-banner-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1;
  min-width: 220px;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
  color: #cbd5e1;
}

.cookie-banner-text a {
  color: #93c5fd;
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 0.625rem;
  flex-shrink: 0;
}

.btn-cookie {
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.btn-cookie:hover { opacity: 0.88; }

.btn-cookie-primary {
  background: #3b82f6;
  color: #fff;
}

.btn-cookie-secondary {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid #475569;
}

@media (max-width: 600px) {
  .cookie-banner-inner { flex-direction: column; align-items: flex-start; }
  .cookie-banner-actions { width: 100%; }
  .btn-cookie { flex: 1; text-align: center; }
}
