/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --blue:       #1a73e8;
  --blue-dark:  #1a1a2e;
  --blue-mid:   #174ea6;
  --blue-light: #e8f0fe;
  --green:      #34a853;
  --red:        #ea4335;
  --grey:       #5f6368;
  --grey-light: #e8eaed;
  --bg:         #f8f9fa;
  --white:      #ffffff;
  --radius:     12px;
  --shadow:     0 2px 12px rgba(0,0,0,.10);
  --shadow-lg:  0 4px 24px rgba(0,0,0,.14);
  --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }   /* prevent display:flex/grid overriding [hidden] */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: #202124;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Ads ───────────────────────────────────────────────────────────────── */
.ad-wrap { background: #fff; border-bottom: 1px solid var(--grey-light); }
.ad-wrap.ad-top { display: flex; justify-content: center; padding: 8px; }
.ad-slot { display: flex; align-items: center; justify-content: center; }
.ad-placeholder {
  color: var(--grey);
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--grey-light);
  border-radius: 4px;
  padding: 4px 12px;
}
.ad-leaderboard { min-width: 320px; min-height: 50px; }
.ad-rect        { width: 300px; min-height: 250px; }
.ad-footer      { min-width: 300px; min-height: 50px; }

/* ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--blue-dark);
  padding: 0 24px;
  box-shadow: var(--shadow);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 1.15rem;
}
.logo-icon { font-size: 1.4rem; }
.logo-text { letter-spacing: .01em; }

.bmc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFDD00;
  color: #000;
  font-weight: 700;
  font-size: .85rem;
  padding: 7px 16px;
  border-radius: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s;
}
.bmc-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }

/* ── Layout ────────────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px;
  flex: 1;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; margin: 20px auto; }
  .ad-rect { display: none; }          /* hide ad placeholder on mobile */
  .sidebar-info { display: none; }     /* hide "How it works" on mobile (inline flow suffices) */
}

/* ── Main content ──────────────────────────────────────────────────────── */
.main-content { min-width: 0; }

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 6px;
}
.page-sub {
  color: var(--grey);
  margin-bottom: 28px;
}
ul.page-sub {
  padding-left: 1.4em;
}
ul.page-sub li {
  margin-bottom: 6px;
}

/* ── Drop zone ─────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed #bdc1c6;
  border-radius: var(--radius);
  background: var(--white);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-light);
}
.drop-icon  { font-size: 2.5rem; margin-bottom: 12px; }
.drop-text  { display: flex; flex-direction: column; gap: 4px; color: var(--grey); }
.drop-text strong { color: #202124; font-size: 1rem; }
.drop-hint  { font-size: .75rem; color: #9aa0a6; letter-spacing: .04em; }
.browse-link {
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
}

/* Inline drop-zone error */
.drop-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fce8e6;
  border: 1px solid #f5c6c2;
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-top: 10px;
  font-size: .9rem;
  color: var(--red);
  font-weight: 500;
}
.drop-error-icon { font-size: 1.1rem; flex-shrink: 0; }

/* Highlight drop zone red on invalid drag */
.drop-zone.invalid {
  border-color: var(--red);
  background: #fce8e6;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--blue-light);
  border: 1px solid #c5d8f8;
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-top: 12px;
}
.file-icon  { font-size: 1.3rem; }
.file-name  { flex: 1; font-weight: 600; font-size: .95rem; color: var(--blue-mid); word-break: break-all; }
.remove-btn {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--grey);
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 50%;
  transition: background .15s;
}
.remove-btn:hover { background: rgba(0,0,0,.1); }

/* ── Operation cards ───────────────────────────────────────────────────── */
.op-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}
@media (max-width: 600px) { .op-grid { grid-template-columns: 1fr; } }

.op-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 20px 14px;
  background: var(--white);
  border: 2px solid var(--grey-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.op-card input[type="radio"] { display: none; }
.op-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.op-card.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: var(--shadow);
}
.op-icon  { font-size: 2rem; }
.op-title { font-weight: 700; font-size: .95rem; color: var(--blue-dark); }
.op-desc  { font-size: .8rem; color: var(--grey); line-height: 1.4; }

/* ── Options panel ─────────────────────────────────────────────────────── */
.options-panel {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.option-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.option-label {
  font-weight: 600;
  font-size: .85rem;
  color: var(--grey);
  min-width: 80px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.radio-group, .check-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.radio-group label, .check-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: .9rem;
}

/* Toggle switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: .9rem;
}
.toggle-label input { display: none; }
.toggle {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #bdc1c6;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
}
.toggle-label input:checked + .toggle { background: var(--green); }
.toggle-label input:checked + .toggle::after { left: 21px; }

/* ── Process button ────────────────────────────────────────────────────── */
.process-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  background: var(--blue);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.process-btn:hover:not(:disabled) { background: var(--blue-mid); transform: translateY(-1px); }
.process-btn:disabled {
  background: #bdc1c6;
  cursor: not-allowed;
  transform: none;
}

/* ── Status area ───────────────────────────────────────────────────────── */
.status-area {
  margin-top: 24px;
  text-align: center;
  padding: 32px 20px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--grey-light);
}

.status-processing, .status-success, .status-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--blue-light);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-msg { font-size: 1rem; color: var(--grey); }
.success-icon, .error-icon { font-size: 2.5rem; }

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 24px;
  text-decoration: none;
  transition: opacity .15s;
}
.dl-btn:hover { opacity: .88; }

.reset-btn, .retry-btn {
  border: 1px solid var(--blue);
  background: var(--white);
  color: var(--blue);
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 24px;
  cursor: pointer;
  transition: background .15s;
}
.reset-btn:hover, .retry-btn:hover { background: var(--blue-light); }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ad-rect {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  min-height: 250px;
}

.sidebar-info {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 20px;
}
.sidebar-info h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 12px;
}
.sidebar-info ol {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .875rem;
  color: var(--grey);
}
.sidebar-info hr { margin: 10px 0; border: none; border-top: 1px solid var(--grey-light); }
.tip { font-size: .82rem; color: var(--grey); line-height: 1.5; }

/* ── Sidebar feedback card ─────────────────────────────────────────────── */
.sidebar-feedback {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 20px;
}
.sidebar-feedback h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 4px;
}
.sidebar-feedback-sub {
  font-size: .82rem;
  color: var(--grey);
  margin-bottom: 14px;
  line-height: 1.4;
}
.sidebar-feedback .cf-row input,
.sidebar-feedback .cf-row textarea {
  font-size: .875rem;
  padding: 8px 10px;
}
.sidebar-feedback .cf-submit {
  width: 100%;
  text-align: center;
  justify-content: center;
  padding: 9px 16px;
  font-size: .875rem;
}
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.cf-row { display: flex; flex-direction: column; gap: 6px; }
.cf-row label {
  font-size: .875rem;
  font-weight: 600;
  color: #202124;
}
.cf-optional { font-weight: 400; color: var(--grey); }
.cf-required  { color: var(--red); }
.cf-row input,
.cf-row textarea {
  border: 1px solid #bdc1c6;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: .95rem;
  color: #202124;
  background: var(--bg);
  transition: border-color .15s;
  resize: vertical;
}
.cf-row input:focus,
.cf-row textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--white);
}
.cf-submit {
  align-self: flex-start;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.cf-submit:hover  { background: var(--blue-mid); }
.cf-submit:disabled { opacity: .6; cursor: not-allowed; }
.cf-status { font-size: .9rem; margin: 0; }
.cf-success { color: var(--green); }
.cf-error   { color: var(--red); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--grey-light);
  padding: 16px 24px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.bmc-footer { font-size: .8rem; padding: 6px 14px; }
.footer-copy { font-size: .78rem; color: var(--grey); }

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.faq-section {
  margin-top: 36px;
}
.faq-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 16px;
}
.faq-item {
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item summary {
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--blue-dark);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--blue);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item[open] summary {
  background: var(--blue-light);
  border-bottom: 1px solid var(--grey-light);
}
.faq-item p {
  padding: 14px 18px;
  font-size: .93rem;
  color: var(--grey);
  line-height: 1.6;
}

/* ── Mobile improvements ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .page-title      { font-size: 1.25rem; }
  .layout          { padding: 0 16px; }
  .drop-zone       { padding: 32px 16px; }
  .site-footer     { padding: 32px 16px; }
  .process-btn     { font-size: .95rem; padding: 13px; }
  .bmc-btn         { font-size: .8rem; padding: 6px 12px; }
  .footer-inner    { flex-direction: column; align-items: flex-start; }
  /* Touch-friendly tap targets */
  .faq-item summary  { padding: 16px; min-height: 48px; }
  .op-card           { padding: 16px 12px; }
  .cf-submit         { min-height: 44px; }
}
