:root {
  color-scheme: light dark;
  font-family: "Open Sans", "Segoe UI", sans-serif;
  --bg: #f6f8fc;
  --surface: rgba(255, 255, 255, 0.96);
  --panel: #ffffff;
  --panel-soft: rgba(248, 250, 252, 0.9);
  --line: rgba(11, 21, 75, 0.08);
  --text: #111827;
  --muted: #5b6475;
  --accent: #0b154b;
  --accent-2: #0fa4e5;
  --button-text: #ffffff;
  --shadow: 0 12px 28px rgba(11, 21, 75, 0.08);
  --radius-xl: 22px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(15, 164, 229, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(15, 164, 229, 0.04) 0%, transparent 24%),
    var(--bg);
  background-attachment: fixed;
}

a,
button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.95rem 1rem 2rem;
  display: grid;
  gap: 0.8rem;
}

.shell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--accent);
  min-width: 0;
}

.brand-logo__mark {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-logo__wordmark {
  display: block;
  height: 26px;
  width: auto;
  object-fit: contain;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.auth-brand__mark {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.auth-brand__wordmark {
  display: block;
  height: 38px;
  width: auto;
  object-fit: contain;
}


.shell-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shell-main,
.page {
  display: grid;
  gap: 0.7rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.45rem 0.95rem;
  flex-wrap: wrap;
  padding: 0 0.1rem;
}

.nav-form {
  margin: 0;
}

.shell-logout-form {
  margin: 0;
}


.nav-link,
.nav-menu a,
.nav-link--button,
button,
.primary-button {
  font: inherit;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 0.48rem 0.8rem;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.nav-link,
.nav-menu a,
.nav-link--button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--accent);
  padding-inline: 0.15rem;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link:hover,
.nav-menu a:hover,
.nav-link--button:hover {
  color: var(--accent-2);
}

.nav-menu a.active,
.nav-link.active {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
}

.primary-button {
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #122a78);
  color: var(--button-text);
  font-weight: 800;
  padding: 0.72rem 1rem;
  box-shadow: 0 10px 20px rgba(11, 21, 75, 0.14);
}

.primary-button:hover,
.nav-link:hover,
.nav-menu a:hover,
.nav-link--button:hover,
button:hover {
  transform: translateY(-1px);
}

.card,
.hero-panel,
.auth-form,
.language-switcher,
.info-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(11, 21, 75, 0.08);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.page {
  gap: 0.7rem;
}

.hero-panel {
  padding: 1.05rem 1.1rem;
  display: grid;
  gap: 0.45rem;
}

.hero-panel--compact {
  padding: 0.85rem 0.95rem;
}

.hero-panel h1,
.hero-panel h2,
.card h2,
.info-card h2,
.auth-form h2 {
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero-panel h1 {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.hero-panel p,
.info-card p,
.card p,
.auth-form p,
.empty-state p,
.muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-note {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-page--compact {
  max-width: 620px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quote-page {
  gap: 0.7rem;
}

.quote-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 0.7rem;
  align-items: start;
}

.quote-grid__sidebar {
  display: grid;
  gap: 0.7rem;
}

.card,
.auth-form,
.language-switcher {
  padding: 0.9rem 0.95rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.feature-card,
.preview-card,
.extraction-card,
.confirmation-card,
.result-card,
.upload-card {
  display: grid;
  gap: 0.7rem;
}

.upload-zone {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem;
  border: 1px dashed rgba(15, 164, 229, 0.28);
  border-radius: var(--radius-lg);
  background: rgba(15, 164, 229, 0.05);
}

.upload-zone--file {
  position: relative;
  cursor: pointer;
}

.upload-zone__button {
  font-weight: 800;
  color: var(--accent);
}

.upload-zone__filename {
  color: var(--muted);
  line-height: 1.4;
}

.upload-zone__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.upload-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
}

.upload-input--hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-input::file-selector-button {
  display: none;
}

.upload-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.03);
}

.workflow-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.workflow-progress__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 180ms ease;
}

.pdf-preview {
  width: 100%;
  min-height: 440px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.summary-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem 0.8rem;
  margin: 0;
}

.summary-list dt {
  color: var(--muted);
}

.summary-list dd {
  margin: 0;
  font-weight: 700;
}

.result-highlight {
  display: grid;
  gap: 0.15rem;
  padding: 0.9rem 0.95rem;
  border-radius: 14px;
  background: rgba(15, 164, 229, 0.06);
  border: 1px solid rgba(15, 164, 229, 0.14);
}

.result-highlight strong {
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.empty-state {
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: var(--panel-soft);
}

.status-chip,
.permission-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-chip--ready,
.permission-badge {
  background: rgba(11, 21, 75, 0.06);
  color: var(--accent);
  border-color: rgba(11, 21, 75, 0.12);
}

.status-chip--busy {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.16);
}

.alert,
.alert-warning {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.18);
  background: rgba(254, 243, 199, 0.55);
  color: #7c2d12;
}

.auth-page {
  width: min(100%, 520px);
  margin-inline: auto;
  min-height: calc(100svh - 9rem);
  align-content: center;
  justify-items: center;
  gap: 0.8rem;
}

.auth-form {
  display: grid;
  gap: 0.8rem;
}

.auth-form--stacked {
  max-width: 100%;
}

.form-field {
  display: grid;
  gap: 0.35rem;
  color: var(--text);
  font-weight: 700;
}

.form-field span,
.language-switcher__label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 40px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
.upload-input:focus {
  border-color: rgba(15, 164, 229, 0.65);
  box-shadow: 0 0 0 3px rgba(15, 164, 229, 0.14);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.language-switcher__label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0px;
  padding: 4px;
}

.language-switcher__select {
  width: auto;
  min-width: 50px;
  min-height: 32px;
  padding: 0.25rem 0.1rem;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.muted {
  color: var(--muted) !important;
}

@media (max-width: 920px) {
  .shell-header {
    align-items: flex-start;
  }

  .quote-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    padding-inline: 0.7rem;
  }

  .shell-header,
  .hero-panel,
  .card,
  .auth-form,
  .language-switcher {
    border-radius: 16px;
  }

  .shell-header {
    flex-direction: column;
  }

  .shell-tools {
    justify-content: flex-start;
  }

  .nav-menu {
    gap: 0.35rem 0.65rem;
  }

  .brand-logo__wordmark {
    height: 22px;
  }

  .auth-brand__wordmark {
    height: 34px;
  }

  .pdf-preview {
    min-height: 340px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08101f;
    --surface: rgba(11, 21, 75, 0.82);
    --panel: #0f172a;
    --panel-soft: rgba(15, 23, 42, 0.78);
    --line: rgba(148, 163, 184, 0.16);
    --text: #f3f4f6;
    --muted: #cbd5e1;
    --accent: #6ea8ff;
    --accent-2: #0fa4e5;
    --button-text: #08101f;
    --shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
  }

  .primary-button {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  }
}
