/* =============================================
   Loconva — Unified Stylesheet
   Dark mode is default; .light-mode on <body> overrides.
   ============================================= */

:root {
  --bg: #0b1120;
  --surface: #111c31;
  --surface-raised: #17233a;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #0ea5b7;
  --accent-hover: #22b8c7;
  --secondary: #6366f1;
  --header-bg: rgba(15, 23, 42, 0.96);
  --header-text: #f8fafc;
  --btn-text: #ffffff;
  --border: #334155;
  --drop-border: #64748b;
  --progress-bg: #334155;
  --focus-outline: #22d3ee;
  --spinner-color: #22b8c7;
  --overlay-bg: rgba(14, 165, 183, 0.16);
  --card-shadow: 0 12px 30px rgba(2, 6, 23, 0.28);
  color-scheme: dark;
}

body.light-mode {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-raised: #f1f5f9;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #0e7490;
  --accent-hover: #155e75;
  --secondary: #4338ca;
  --header-bg: rgba(255, 255, 255, 0.96);
  --header-text: #1e293b;
  --btn-text: #ffffff;
  --border: #cbd5e1;
  --drop-border: #94a3b8;
  --progress-bg: #e2e8f0;
  --focus-outline: #4338ca;
  --spinner-color: #0e7490;
  --overlay-bg: rgba(14, 116, 144, 0.1);
  --card-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 4%, rgba(67, 56, 202, 0.12), transparent 28rem),
    radial-gradient(circle at 92% 20%, rgba(14, 165, 183, 0.11), transparent 30rem);
  background-attachment: fixed;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

.support-warning {
  padding: 0.85rem 1rem;
  color: #78350f;
  background: #fef3c7;
  border-bottom: 1px solid #f59e0b;
  text-align: center;
}

.footer-preference-button {
  margin-top: 0.75rem;
  padding: 0.5rem 0.7rem;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 0.5rem;
  cursor: pointer;
}

.footer-preference-button:disabled { opacity: 0.55; cursor: wait; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

a { color: var(--accent); }

/* ===== HEADER / TOP BAR ===== */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0.5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
  transition: background 0.3s;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  padding: 0.2rem 0.45rem;
  border-radius: 10px;
  background: #ffffff;
}

.header-navigation {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 1rem;
}

.logo-link img {
  display: block;
  height: 48px;
  width: auto;
}

.logo-text {
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.main-nav { flex: 1; display: flex; justify-content: flex-start; margin-left: 1rem; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--header-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: opacity 0.2s;
}

.main-nav a:hover {
  color: var(--accent);
}

/* Auth nav — right-aligned, before dark mode toggle */
.auth-nav {
  flex-shrink: 0;
}

.auth-nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

.auth-nav a {
  color: var(--header-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: opacity 0.2s;
}

.auth-nav a:hover {
  color: var(--accent);
}

.auth-nav li:last-child a {
  display: inline-flex;
  padding: 0.45rem 0.85rem;
  border-radius: 9px;
  background: linear-gradient(135deg, #4338ca, #0e7490);
  color: #ffffff;
}

.mobile-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-raised);
  cursor: pointer;
}

.mobile-nav-toggle > span:not(.sr-only) {
  display: block;
  width: 100%;
  height: 2px;
  margin: 4px 0;
  border-radius: 999px;
  background: var(--header-text);
}

.theme-toggle {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--header-text);
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(14, 116, 144, 0.16);
}

.theme-toggle-icon {
  grid-area: 1 / 1;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle-sun { display: none; }
html.dark .theme-toggle-moon { display: none; }
html.dark .theme-toggle-sun { display: block; }

.account-nav-link {
  width: 42px;
  height: 42px;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
}

.account-nav-link svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== ACCESSIBILITY ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px;
  z-index: 1100;
}

.skip-link:focus { top: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}

/* ===== MAIN CONTENT ===== */
.main-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  flex: 1 0 auto;
}

.hero {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6.5rem) 1rem 3rem;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.45rem, 7vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero h1,
.pricing-page h1,
.auth-page h1,
.account-page h1,
.about-page h1 {
  background: linear-gradient(115deg, var(--secondary), var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.hero-eyebrow,
.result-kicker,
.legal-kicker {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-subtitle {
  max-width: 700px;
  margin: 1.5rem auto 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.hero-proof li {
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--card-shadow);
}

.hero-proof li::before { content: '✓'; margin-right: 0.4rem; color: var(--accent); }

/* ===== DROP ZONE ===== */
.drop-zone {
  border: 2px dashed var(--drop-border);
  border-radius: 16px;
  padding: 2rem;
  background: var(--surface);
  box-shadow: var(--card-shadow);
  text-align: center;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, transform 0.2s;
}

.drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(67, 56, 202, 0.16), rgba(14, 165, 183, 0.16));
  color: var(--accent);
}

.drop-text { margin: 1rem 0 0; font-size: 1.15rem; font-weight: 700; }
.drop-action { margin: 0.15rem 0; color: var(--text-muted); }
.drop-hint { margin: 0.75rem 0 0; color: var(--text-muted); font-size: 0.85rem; }

.drop-zone.dragover {
  background: var(--overlay-bg);
  border-color: var(--accent);
  transform: scale(1.01);
}

.drop-zone.dragover .drop-icon {
  transform: scale(1.2);
  transition: transform 0.2s;
}

.drop-zone-content { pointer-events: none; }

.file-input-hidden { display: none; }

/* ===== WINDOW-WIDE DRAG OVERLAY ===== */
#drag-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--overlay-bg);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  pointer-events: none;
}

#drag-overlay.active { display: flex; }

/* ===== FILE CARDS ===== */
.file-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: background 0.3s;
}

.file-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.file-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.file-thumbnail {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.file-info { flex: 1; min-width: 0; }

.file-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  font-size: 0.85rem;
  color: var(--text);
  opacity: 0.7;
}

.file-card .remove-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform 0.2s, background 0.2s;
}

.file-card .remove-btn:hover { transform: scale(1.1); }

.conversion-row {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.source-badge {
  background: linear-gradient(135deg, #4338ca, #0e7490);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.2rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.target-options { flex: 1; min-width: 0; }

.target-options h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.target-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.target-btn {
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.target-btn:hover {
  background: var(--overlay-bg);
  border-color: var(--accent);
}

.target-btn.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.convert-action-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== BATCH CONTROLS ===== */
.batch-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
  flex-wrap: wrap;
}

.batch-controls label {
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.8;
}

.batch-controls select {
  padding: 0.4rem 0.8rem;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ===== KEYBOARD HINT ===== */
.kbd-hint {
  font-size: 0.8rem;
  color: var(--text);
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: monospace;
  background: var(--surface);
}

/* ===== UNSUPPORTED ===== */
.unsupported-msg {
  background: var(--overlay-bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text);
  text-align: center;
}

/* ===== ALL FORMATS BROWSER ===== */
.all-formats-section { margin-top: 1rem; }
.all-formats-section h2 { color: var(--text); }

/* ===== FORMAT CATEGORIES ===== */
.format-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.format-category {
  background: var(--surface);
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: background 0.3s;
}

.format-category h3 { color: var(--text); margin-top: 0; }

.format-buttons {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.format-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.format-btn:hover,
.format-btn.selected {
  background: var(--accent);
  color: var(--btn-text);
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, #4338ca, #0e7490);
  color: var(--btn-text);
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(67, 56, 202, 0.2);
  transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(14, 116, 144, 0.24);
}

.btn-primary:disabled {
  background: #555;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--surface-raised);
  transform: translateY(-1px);
}

.btn-cancel,
.btn-retry {
  background: #555;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: background 0.2s;
}

.btn-cancel:hover, .btn-retry:hover { background: #666; }

.btn-danger {
  padding: 0.65rem 1rem;
  border: 1px solid #ef4444;
  border-radius: 8px;
  color: #f87171;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

body.light-mode .btn-danger { color: #b91c1c; }

.btn-danger:hover:not(:disabled) {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.22);
}

.btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== PROGRESS BAR ===== */
.status-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.progress-track {
  background: var(--progress-bg);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  flex: 1;
  position: relative;
  transition: background 0.3s;
}

.progress-fill {
  background: linear-gradient(90deg, var(--secondary), var(--accent), var(--secondary));
  background-size: 200% 100%;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.3s ease;
  animation: shimmer 2s linear infinite;
  box-shadow: 0 0 10px rgba(14, 165, 183, 0.45);
}

@keyframes shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: -200% 0; }
}

.progress-fill.indeterminate {
  width: 40%;
  animation: indeterminate-slide 1.5s ease-in-out infinite, shimmer 2s linear infinite;
}

@keyframes indeterminate-slide {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

.status-message { color: var(--text); }

/* ===== SPINNER ===== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--progress-bg);
  border-top-color: var(--spinner-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

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

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--surface);
  color: var(--text);
  padding: 1rem 2.5rem 1rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s;
  position: relative;
  max-width: 400px;
  word-wrap: break-word;
}

.toast-close {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text);
  opacity: 0.5;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem;
  line-height: 1;
}

.toast-close:hover { opacity: 1; }

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ===== FEATURES GRID ===== */
.features { padding: 2rem 1rem; }

.features h2 { text-align: center; color: var(--text); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 2rem auto;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover { transform: translateY(-3px); border-color: var(--accent); }

.feature-card h3 {
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.feature-card p { color: var(--text); opacity: 0.8; }

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--overlay-bg);
  font-size: 1.3rem;
}

/* ===== CONVERSION RESULT / CLOUD EXPORT ===== */
.result-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 1.25rem 2rem;
  align-items: center;
  margin: 1.5rem 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.result-actions[hidden] { display: none; }
.result-actions h2 { margin: 0; color: var(--text); font-size: 1.25rem; }
.result-kicker { margin-bottom: 0.25rem; }
.result-filename { margin: 0.2rem 0 0; color: var(--text-muted); word-break: break-word; }
.result-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.65rem; }

.btn-compact,
.btn-cloud {
  min-height: 42px;
  padding: 0.65rem 1rem;
  border-radius: 9px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-cloud {
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s;
}

.btn-cloud:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.btn-cloud:disabled { cursor: wait; opacity: 0.7; }

.cloud-privacy-note {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ===== LEGAL PAGES ===== */
.legal-page,
.cloud-callback {
  max-width: 820px;
  margin: 3rem auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.legal-page h1,
.cloud-callback h1 {
  margin-top: 0;
  color: var(--text);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
}

.legal-page h2 { margin-top: 2rem; color: var(--text); font-size: 1.15rem; }
.legal-page p, .legal-page li, .legal-page address, .legal-page blockquote { color: var(--text-muted); }
.legal-page address { font-style: normal; }
.legal-page blockquote { margin-left: 0; padding: 1rem 1.25rem; border-left: 3px solid var(--accent); background: var(--surface-raised); }

.legal-placeholder {
  margin: 1rem 0 2rem;
  padding: 1rem;
  border: 1px solid #d97706;
  border-radius: 10px;
  background: rgba(217, 119, 6, 0.1);
  color: var(--text);
}

.legal-updated { margin-top: 2rem; font-size: 0.85rem; }

.cloud-callback { text-align: center; }
.cloud-callback .spinner { width: 38px; height: 38px; margin-bottom: 1rem; }
.cloud-return { display: inline-flex; margin-top: 1rem; text-decoration: none; }
.cloud-return[hidden] { display: none; }

/* ===== HELP, STATUS, AND ERROR PAGES ===== */
.help-page,
.status-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1rem 0;
}

.page-hero {
  max-width: 760px;
  margin-bottom: 2rem;
}

.page-hero h1,
.not-found-page h1 {
  margin: 0.2rem 0 0.75rem;
  color: var(--text);
  font-size: clamp(2.2rem, 6vw, 3.75rem);
  line-height: 1.08;
}

.page-hero > p:last-child,
.not-found-page > p { color: var(--text-muted); }

.page-eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.help-search-panel {
  margin-bottom: 2.5rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.help-search-panel > label,
#help-category-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 700;
}

#help-search {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.help-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

#help-category-label { flex-basis: 100%; }

.help-filter {
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.help-filter:hover,
.help-filter.is-active {
  border-color: var(--accent);
  background: var(--overlay-bg);
  color: var(--text);
}

.help-results-status {
  min-height: 1.5rem;
  margin: 0.8rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.help-page h2,
.status-note h2 { color: var(--text); }

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.help-card,
.faq-item,
.status-card,
.status-note {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.help-card { padding: 1.25rem; }
.help-card h3 { margin: 0 0 0.45rem; color: var(--text); }
.help-card p { color: var(--text-muted); }
.help-card .help-summary { color: var(--text); font-weight: 650; }

.faq-section {
  margin-top: 3rem;
  scroll-margin-top: 6rem;
}

.faq-section > p { color: var(--text-muted); }
.faq-item { margin-top: 0.75rem; padding: 0 1rem; }
.faq-item summary {
  padding: 1rem 2rem 1rem 0;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.faq-item p { margin-top: 0; color: var(--text-muted); }

.help-empty {
  margin: 2rem 0;
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
}
.help-empty p { color: var(--text-muted); }

.service-overview {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.service-overview strong { color: var(--text); font-size: 1.15rem; }
.service-overview p { margin: 0.15rem 0 0; color: var(--text-muted); }

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.status-card { padding: 1.25rem; }
.status-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.status-card h2 { margin: 0; color: var(--text); font-size: 1.05rem; }
.status-card p { color: var(--text-muted); }
.status-card .component-status { color: var(--text); font-weight: 750; }

.status-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14);
}

[data-state="operational"] .status-dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14); }
[data-state="degraded"] .status-dot { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14); }
[data-state="unavailable"] .status-dot,
[data-state="connection_error"] .status-dot { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14); }

.status-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0;
}
.status-controls p { color: var(--text-muted); }
.status-note { padding: 1.25rem; }
.status-note h2 { margin-top: 0; font-size: 1.05rem; }
.status-note p { margin-bottom: 0; color: var(--text-muted); }

.not-found-page {
  max-width: 760px;
  margin: 4rem auto;
  padding: clamp(1.5rem, 5vw, 3rem);
  text-align: center;
}
.not-found-code {
  margin: 0;
  color: var(--accent);
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 850;
  line-height: 1;
  opacity: 0.28;
}
.requested-path code {
  overflow-wrap: anywhere;
  color: var(--text);
}
.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}
.not-found-actions .btn-primary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.contact-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1rem 0;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, 0.75fr);
  gap: 1.5rem;
  align-items: start;
}

.contact-form,
.contact-guidance,
.contact-success {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.contact-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-field { margin-bottom: 1rem; }
.contact-field label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-weight: 700;
}
.contact-field label span { color: var(--text-muted); font-size: 0.78rem; font-weight: 500; }
.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.contact-field textarea { resize: vertical; min-height: 11rem; }
.contact-field [aria-invalid="true"] { border-color: #ef4444; }
.field-hint,
.field-error { margin: 0.35rem 0 0; font-size: 0.82rem; }
.field-hint { color: var(--text-muted); }
.field-error { min-height: 1.25rem; color: #f87171; }
body.light-mode .field-error { color: #b91c1c; }

.contact-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: var(--text);
}
.contact-consent input { margin-top: 0.35rem; }

.form-error-summary {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid #ef4444;
  border-radius: 9px;
  background: rgba(239, 68, 68, 0.08);
  color: var(--text);
}
.form-error-summary p { margin: 0.25rem 0 0; }

.contact-guidance h2,
.contact-success h2 { margin-top: 0; color: var(--text); font-size: 1.15rem; }
.contact-guidance h2:not(:first-child) { margin-top: 2rem; }
.contact-guidance p,
.contact-success p { color: var(--text-muted); }
.contact-success { max-width: 720px; }
.contact-success code { color: var(--text); font-weight: 800; }
#contact-submit-status { min-height: 1.5rem; color: var(--text-muted); }

.contact-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* ===== API DOCUMENTATION ===== */
.api-docs-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1rem 0;
}

.api-docs-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.api-upload-notice {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: rgba(14, 165, 183, 0.08);
}
.api-upload-notice h2 { margin: 0 0 0.35rem; color: var(--text); font-size: 1.1rem; }
.api-upload-notice p { margin: 0; color: var(--text-muted); }
.api-docs-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2rem; align-items: start; }
.api-docs-sidebar {
  position: sticky;
  top: 6rem;
  display: grid;
  gap: 0.45rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.api-docs-sidebar h2 { margin: 0 0 0.4rem; font-size: 1rem; color: var(--text); }
.api-docs-sidebar a { color: var(--text-muted); text-decoration: none; }
.api-docs-sidebar a:hover { color: var(--accent); }
.api-docs-content { min-width: 0; }
.api-docs-content > section { margin-bottom: 2rem; scroll-margin-top: 6rem; }
.api-docs-content h2 { color: var(--text); }
.api-docs-content p { color: var(--text-muted); }
.api-docs-content pre {
  overflow-x: auto;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #07101f;
  color: #dbeafe;
}
.api-docs-content code { overflow-wrap: anywhere; }
.api-endpoint-search {
  width: 100%;
  margin: 0.4rem 0 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.api-endpoint-list { display: grid; gap: 0.85rem; }
.api-endpoint-card {
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.api-endpoint-card h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; margin: 0; color: var(--text); }
.api-endpoint-card h3 code { min-width: 0; word-break: break-word; }
.api-endpoint-card p { margin: 0.55rem 0 0; }
.api-method { padding: 0.15rem 0.5rem; border-radius: 5px; color: #fff; font-size: 0.75rem; letter-spacing: 0.04em; }
.api-method-get { background: #047857; }
.api-method-post { background: #4338ca; }
.api-endpoint-description { font-size: 0.9rem; }
.api-response-list { font-size: 0.82rem; font-weight: 700; }

/* ===== FOOTER ===== */
.site-footer {
  position: relative;
  overflow: hidden;
  background: #0f172a;
  color: #cbd5e1;
  padding: 3.5rem 1rem 1.5rem;
  margin-top: 4rem;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #4338ca, #0ea5b7) 1;
}

.site-footer::before {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  right: -160px;
  top: -220px;
  border-radius: 50%;
  background: rgba(14, 165, 183, 0.12);
  pointer-events: none;
}

.footer-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(250px, 1.6fr) repeat(5, minmax(110px, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}

.footer-brand { max-width: 360px; }

.footer-logo-link {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
  background: #ffffff;
}

.footer-logo-link img {
  display: block;
  width: auto;
  height: 44px;
}

.footer-brand p {
  max-width: 34rem;
  margin: 1.15rem 0;
  color: #cbd5e1;
}

.footer-trust {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #99f6e4;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.footer-trust::before {
  content: '';
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.13);
}

.footer-col h2,
.footer-preferences > label {
  display: block;
  margin: 0 0 0.9rem;
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li + li { margin-top: 0.55rem; }

.footer-col a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover { color: #67e8f9; }

.language-select-wrap { position: relative; }

.language-select-wrap::after {
  content: '';
  position: absolute;
  right: 0.9rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #67e8f9;
  border-bottom: 2px solid #67e8f9;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

#footer-language {
  width: 100%;
  min-width: 150px;
  appearance: none;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 10px;
  padding: 0.65rem 2.4rem 0.65rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

#footer-language:hover { border-color: #0ea5b7; }

.footer-preferences p {
  margin: 0.55rem 0 0;
  color: #94a3b8;
  font-size: 0.78rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #334155;
  color: #94a3b8;
  font-size: 0.85rem;
}

.footer-bottom p { margin: 0; }

/* ===== ABOUT / PRIVACY PAGES ===== */
.about-page { padding: 2rem 1rem; max-width: 800px; margin: 0 auto; }
.about-page h1, .about-page h2 { color: var(--text); }
.about-page p, .about-page li { color: var(--text); }
.about-page code {
  background: var(--surface);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
  .footer-main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; max-width: 560px; }
}

@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
  }

  .logo-link { margin-right: auto; }
  .logo-link img { height: 42px; }

  .mobile-nav-toggle { display: block; }

  .header-navigation {
    display: none;
    order: 4;
    width: 100%;
    flex: 0 0 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 0.75rem;
  }

  .header-navigation.is-open { display: flex; }

  .main-nav {
    margin: 0;
  }

  .main-nav ul,
  .auth-nav ul {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .main-nav a,
  .auth-nav a,
  .auth-nav li:last-child a {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
  }

  .main-nav a:hover,
  .auth-nav a:hover { background: var(--surface-raised); }

  .auth-nav .account-nav-link {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    gap: 0.65rem;
  }

  .auth-nav .account-nav-link .sr-only {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
  }

  .auth-nav {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

  .format-categories { grid-template-columns: 1fr; }

  .help-grid,
  .status-grid,
  .contact-layout,
  .contact-field-row,
  .api-docs-grid { grid-template-columns: 1fr; }

  .api-docs-sidebar { position: static; }

  .status-controls { align-items: flex-start; flex-direction: column; }

  .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .footer-brand { grid-column: 1 / -1; }

  .footer-preferences {
    grid-column: 1 / -1;
    max-width: 320px;
  }

  .footer-bottom { flex-direction: column; }

  .result-actions { grid-template-columns: 1fr; }
  .result-buttons { justify-content: flex-start; }

  .conversion-row { flex-direction: column; }

  .source-badge { width: 100%; min-width: 0; }

  .target-options { width: 100%; }

  .target-formats { justify-content: center; }
}

@media (max-width: 520px) {
  .site-footer { padding-top: 2.75rem; }

  .footer-main { grid-template-columns: 1fr; }

  .footer-brand { grid-column: auto; }

  .footer-preferences {
    grid-column: auto;
    max-width: none;
  }

  .footer-logo-link img { height: 40px; }
}

/* ===== TIER BADGE ===== */
.tier-badge {
  background: var(--accent);
  color: #fff;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
