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

/* ── Design tokens ── */
:root {
  --blue-dark:  #0f3460;
  --blue-mid:   #1a56a0;
  --blue-light: #2a7de1;
  --blue-pale:  #e8f1fd;
  --white:      #ffffff;
  --bg:         #f4f8ff;
  --text-main:  #1a1f36;
  --text-muted: #5a6478;
  --border:     #dce6f7;
  --radius:     12px;
  --shadow:     0 2px 12px rgba(15,52,96,0.08);
  --green:      #16a34a;
  --green-pale: #dcfce7;
  --red:        #dc2626;
  --red-pale:   #fee2e2;
}

body {
  font-family: 'Plus Jakarta Sans', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
}

/* ── Skip link ── */
.skip-link {
  position: absolute; top: -100px; left: 16px;
  background: var(--blue-dark); color: #fff;
  padding: 8px 16px; border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14px; text-decoration: none; z-index: 999; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── Header ── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  height: 62px; display: flex; align-items: center; justify-content: space-between;
}
.logo { font-size: 22px; font-weight: 700; color: var(--blue-dark); letter-spacing: -0.5px; text-decoration: none; }
.logo span { color: var(--blue-light); }
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
  text-decoration: none; font-size: 14px; font-weight: 500;
  color: var(--text-muted); padding: 6px 14px; border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover { background: var(--blue-pale); color: var(--blue-light); }

/* ── Container ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── Breadcrumb ── */
.breadcrumb-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.breadcrumb {
  list-style: none; display: flex; align-items: center;
  gap: 6px; font-size: 13px; color: var(--text-muted);
}
.breadcrumb a { color: var(--blue-light); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb li[aria-current="page"] { color: var(--text-main); font-weight: 500; }

/* ── Tool hero ── */
.tool-hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 60%, var(--blue-light) 100%);
  color: var(--white); text-align: center; padding: 48px 24px 40px;
}
.tool-hero-icon {
  width: 64px; height: 64px; border-radius: 16px;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin: 0 auto 16px;
}
.tool-hero h1 { font-size: clamp(24px, 4vw, 38px); font-weight: 700; letter-spacing: -0.5px; margin-bottom: 12px; }
.tool-hero p { font-size: 16px; opacity: 0.88; max-width: 520px; margin: 0 auto; }

/* ── Tool section ── */
.tool-section { padding: 40px 0; }

.tool-card-main {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 620px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--blue-light);
  background: var(--blue-pale);
}
.upload-zone i { font-size: 40px; color: var(--blue-light); margin-bottom: 14px; display: block; }
.upload-title { font-size: 16px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.upload-sub { font-size: 13px; color: var(--text-muted); }
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

/* File selected */
.file-info {
  display: flex; align-items: center; gap: 14px;
  background: var(--blue-pale); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.file-info .fa-file-pdf { font-size: 28px; color: var(--blue-light); flex-shrink: 0; }
.file-name { font-size: 14px; font-weight: 600; color: var(--text-main); word-break: break-all; }
.file-size { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.file-remove {
  margin-left: auto; background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px;
  border-radius: 50%; transition: color 0.2s, background 0.2s; flex-shrink: 0;
}
.file-remove:hover { color: var(--red); background: var(--red-pale); }

/* Options */
.tool-options { margin-top: 24px; }
.option-label { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; display: block; margin-bottom: 12px; }
.rotation-options { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.rotation-btn { cursor: pointer; }
.rotation-btn input { display: none; }
.rotation-btn span {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--border);
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  background: var(--white); transition: all 0.15s; cursor: pointer;
}
.rotation-btn input:checked + span {
  border-color: var(--blue-light); background: var(--blue-pale); color: var(--blue-dark);
}
.rotation-btn span:hover { border-color: var(--blue-light); color: var(--blue-dark); }

.btn-rotate {
  width: 100%; padding: 14px; border-radius: var(--radius);
  background: var(--blue-light); color: #fff; border: none;
  font-size: 16px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background 0.2s, transform 0.15s;
  font-family: inherit;
}
.btn-rotate:hover { background: var(--blue-mid); transform: translateY(-1px); }
.btn-rotate:active { transform: translateY(0); }

/* Progress */
.tool-progress { text-align: center; padding: 16px 0; }
.progress-bar { background: var(--border); border-radius: 999px; height: 8px; overflow: hidden; margin-bottom: 12px; }
.progress-fill { height: 100%; background: var(--blue-light); border-radius: 999px; width: 0; transition: width 0.4s ease; }
#progressText { font-size: 14px; color: var(--text-muted); }

/* Result */
.tool-result { text-align: center; padding: 16px 0; }
.tool-result .fa-check-circle { font-size: 48px; color: var(--green); margin-bottom: 12px; display: block; }
.tool-result p { font-size: 16px; font-weight: 600; color: var(--text-main); margin-bottom: 20px; }
.btn-download {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; background: var(--green); color: #fff;
  border: none; border-radius: var(--radius); font-size: 15px; font-weight: 600;
  cursor: pointer; margin-bottom: 12px; transition: background 0.2s;
  font-family: inherit;
}
.btn-download:hover { background: #15803d; }
.btn-again {
  display: block; margin: 0 auto;
  background: none; border: none; color: var(--blue-light);
  font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: underline;
  font-family: inherit;
}

/* Error */
.tool-error { text-align: center; padding: 16px 0; }
.tool-error .fa-exclamation-triangle { font-size: 40px; color: var(--red); margin-bottom: 12px; display: block; }
.tool-error p { font-size: 15px; color: var(--text-muted); margin-bottom: 16px; }

/* Trust row */
.trust-row {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 20px;
  margin-top: 20px; max-width: 620px; margin-left: auto; margin-right: auto;
}
.trust-row span { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.trust-row i { color: var(--blue-light); }

/* ── Content section ── */
.content-section { padding: 56px 0; }
.content-grid { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }

.content-main h2 { font-size: 22px; font-weight: 700; color: var(--blue-dark); margin: 32px 0 12px; }
.content-main h2:first-child { margin-top: 0; }
.content-main h3 { font-size: 17px; font-weight: 600; color: var(--text-main); margin: 24px 0 10px; }
.content-main p { font-size: 15px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.7; }
.content-main a { color: var(--blue-light); }

.guide-steps, .guide-list {
  margin: 0 0 16px 20px; display: flex; flex-direction: column; gap: 10px;
}
.guide-steps li, .guide-list li { font-size: 15px; color: var(--text-muted); line-height: 1.65; }
.guide-steps li strong, .guide-list li strong { color: var(--text-main); }

/* Sidebar */
.content-sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.sidebar-card h3 { font-size: 14px; font-weight: 700; color: var(--blue-dark); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.8px; }
.sidebar-tools { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sidebar-tools a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-main);
  text-decoration: none; transition: background 0.15s, color 0.15s;
}
.sidebar-tools a:hover { background: var(--blue-pale); color: var(--blue-light); }
.sidebar-tools i { color: var(--blue-light); width: 16px; text-align: center; flex-shrink: 0; }
.tip-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tip-list li { font-size: 13px; color: var(--text-muted); display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.tip-list .fa-lightbulb { color: #eab308; margin-top: 2px; flex-shrink: 0; }

/* ── Section alt (FAQ) ── */
.section-alt {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 0;
}
.section-alt h2 { font-size: 26px; font-weight: 700; color: var(--blue-dark); margin-bottom: 10px; }
.section-intro { font-size: 15px; color: var(--text-muted); margin-bottom: 28px; }
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px; font-size: 15px; font-weight: 600;
  color: var(--text-main); cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 20px; font-weight: 400; color: var(--blue-light); transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] summary { border-bottom: 1px solid var(--border); color: var(--blue-dark); }
.faq-item p { padding: 16px 20px; font-size: 14px; color: var(--text-muted); line-height: 1.65; }

/* ── Footer ── */
.site-footer { background: var(--blue-dark); color: rgba(255,255,255,0.7); padding: 48px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.footer-brand { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 10px; letter-spacing: -0.5px; }
.footer-text { font-size: 14px; line-height: 1.6; max-width: 220px; }
.footer-heading { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 14px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 20px 24px; }
.footer-meta { font-size: 13px; color: rgba(255,255,255,0.45); text-align: center; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .nav-links { display: none; }
  .tool-card-main { padding: 20px 16px; }
  .rotation-options { flex-direction: column; }
  .rotation-btn span { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .trust-row { flex-direction: column; align-items: center; }
}
