:root {
  --topbar-height: 72px;
  color-scheme: dark;
  --ink: #f2f0ea;
  --muted: #aaa39a;
  --line: #332f2a;
  --paper: #11100e;
  --panel: #191715;
  --accent: #d8d8d8;
  --accent-strong: #ffffff;
  --warm: #f59e55;
  --blue: #93b6ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

main > section[id] {
  scroll-margin-top: calc(var(--topbar-height) + 16px);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 360px),
    var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.language-input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #11100e;
  color: var(--ink);
}

.language-input:focus {
  border-color: #77716a;
  outline: 2px solid rgba(255, 255, 255, 0.12);
  outline-offset: 1px;
}

.language-picker {
  position: relative;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  display: grid;
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141210;
  box-shadow: var(--shadow);
  scrollbar-color: #514b44 #141210;
}

.language-menu[hidden] {
  display: none;
}

.language-option {
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.language-option:last-of-type {
  border-bottom: 0;
}

.language-option:hover,
.language-option.highlighted {
  background: #1f1b17;
}

.language-menu-note {
  padding: 11px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(51, 47, 42, 0.9);
  background: rgba(17, 16, 14, 0.88);
  backdrop-filter: blur(16px);
}

.brand,
.nav,
.trust-row,
.estimate {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 760;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 8px solid var(--accent);
  border-right-color: var(--warm);
  border-radius: 50%;
}

.nav {
  gap: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.ghost-button,
.primary-button,
.credit-card {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.ghost-button {
  min-height: 40px;
  padding: 0 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account,
.locale-switcher {
  position: relative;
}

.locale-toggle {
  min-width: 46px;
  padding-inline: 10px;
  font-weight: 760;
}

.account-menu,
.locale-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141210;
  box-shadow: var(--shadow);
}

.account-menu[hidden],
.locale-menu[hidden] {
  display: none;
}

.locale-menu.align-left {
  right: auto;
  left: 0;
}

.account-menu a,
.account-menu button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.account-menu a {
  display: flex;
  align-items: center;
}

.account-menu button {
  border-bottom: 0;
  color: var(--muted);
}

.locale-menu a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.locale-menu a:last-child {
  border-bottom: 0;
}

.account-menu a:hover,
.account-menu button:hover,
.locale-menu a:hover,
.locale-menu a.active {
  background: #1f1b17;
  color: var(--ink);
}

.section {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: clamp(32px, 6vw, 84px);
  align-items: center;
  min-height: auto;
  padding-top: 42px;
  padding-bottom: 56px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 22px;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.lead {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.65;
}

.trust-row {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.trust-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #c8c2b8;
  font-size: 0.9rem;
}

.upload-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 28px);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dropzone {
  position: relative;
  min-height: 190px;
  border: 1px dashed #b9b1a6;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(245, 158, 85, 0.08)),
    #141311;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone label {
  display: grid;
  place-items: center;
  gap: 10px;
  height: 100%;
  min-height: 190px;
  padding: 24px;
  text-align: center;
}

.file-icon {
  width: 76px;
  height: 52px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 14px, rgba(255, 255, 255, 0.24) 14px 18px, transparent 18px),
    linear-gradient(0deg, transparent 18px, rgba(245, 158, 85, 0.24) 18px 22px, transparent 22px);
}

.dropzone small,
.form-note,
.job-time,
.credit-card small,
.estimate span,
.stats span {
  color: var(--muted);
}

.job-time {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: #d9d4cb;
  font-size: 0.9rem;
  font-weight: 680;
}

select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #11100e;
  color: var(--ink);
}

input[type="email"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #11100e;
  color: var(--ink);
}

.estimate {
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141311;
}

.estimate div {
  display: grid;
  gap: 4px;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  border-color: #4a4640;
  background: #26231f;
  color: #f2f0ea;
  font-weight: 760;
}

.primary-button:hover {
  border-color: #6a655d;
  background: #312d28;
}

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

.form-note {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 0.9rem;
}

.form-note.insufficient {
  color: #e6a49a;
}

.site-footer {
  display: grid;
  justify-items: center;
  gap: 24px;
  padding: 44px 18px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 42px;
}

.site-footer a {
  color: #d9d4cb;
}

.site-footer a:hover {
  color: var(--ink);
}

.legal-page {
  max-width: 880px;
  min-height: 100vh;
  padding-top: 120px;
  padding-bottom: 120px;
}

.legal-page h1 {
  margin: 0 0 24px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.95;
}

.legal-page p {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.legal-page a {
  color: var(--ink);
  font-weight: 800;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-section .section-heading {
  display: block;
  margin-bottom: 20px;
}

.dashboard-section .section-heading .eyebrow {
  margin-bottom: 8px;
}

.dashboard-section .section-heading h2 {
  font-size: 2.5rem;
  line-height: 1.08;
}

.stats,
.credit-options {
  display: grid;
  gap: 14px;
}

.stats {
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 32px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 23, 21, 0.72);
}

.credit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 23, 21, 0.9);
}

.stats article {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.stats article:last-child {
  border-right: 0;
}

.stats span {
  font-size: 0.78rem;
}

.stats strong {
  font-size: 1.55rem;
}

.job-list {
  display: block;
}

.job-group + .job-group {
  margin-top: 30px;
}

.job-group-title {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.active-job-list {
  display: grid;
  gap: 10px;
}

.active-job,
.history-job {
  border: 1px solid var(--line);
  background: rgba(25, 23, 21, 0.72);
}

.active-job {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(320px, 480px) auto;
  align-items: center;
  gap: 28px;
  padding: 18px;
  border-radius: 8px;
}

.job-summary {
  min-width: 0;
}

.job-summary h3 {
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}

.active-job .job-summary h3,
.history-job .job-summary h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.active-job .job-summary h3 {
  -webkit-line-clamp: 3;
}

.history-job .job-summary h3 {
  -webkit-line-clamp: 2;
}

.job-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.job-meta span {
  padding: 0 4px;
  color: #6f6961;
}

.active-job-progress {
  min-width: 0;
}

.history-job-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 23, 21, 0.58);
}

.history-job {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(150px, 190px) 92px 96px;
  align-items: center;
  column-gap: 22px;
  row-gap: 8px;
  min-height: 74px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.history-job:last-child {
  border-bottom: 0;
}

.history-job time {
  justify-self: start;
  color: var(--muted);
  font-size: 0.82rem;
}

.job-load-more {
  display: block;
  min-height: 38px;
  margin: 12px auto 0;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 680;
  cursor: pointer;
}

.job-load-more:hover {
  color: var(--ink);
}

.dashboard-empty {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 23, 21, 0.72);
}

.dashboard-empty p {
  margin-bottom: 0;
  color: var(--muted);
}

.job-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.job-stage strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.status {
  width: fit-content;
  justify-self: start;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 760;
}

.in-progress {
  background: rgba(49, 95, 159, 0.12);
  color: var(--blue);
}

.queued {
  background: rgba(197, 106, 52, 0.14);
  color: #ffbd82;
}

.done {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent-strong);
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #2a2722;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--warm));
}

.active-job button,
.history-job button {
  justify-self: end;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151311;
  color: var(--ink);
  cursor: pointer;
}

.active-job button:hover,
.history-job button:hover {
  border-color: #6a655d;
  background: #211e1a;
}

.credit-options {
  grid-template-columns: repeat(3, 1fr);
}

.credit-card {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 22px;
  text-align: left;
}

.credit-card strong {
  font-size: 1.55rem;
}

.credit-card.featured {
  border-color: var(--accent);
  background: #20201e;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100% - 36px));
  transform: translateY(24px);
  opacity: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #f2f0ea;
  color: #11100e;
  box-shadow: var(--shadow);
  transition: 180ms ease;
  pointer-events: none;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.auth-dialog,
.detail-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.68);
}

.auth-dialog[hidden],
.detail-dialog[hidden] {
  display: none;
}

.auth-panel,
.detail-panel {
  width: min(440px, calc(100% - 32px));
  max-width: calc(100vw - 32px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.auth-panel,
.detail-panel {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 28px;
}

.auth-panel h2,
.detail-panel h2 {
  font-size: 1.8rem;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.auth-panel p,
.detail-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.auth-panel label {
  display: grid;
  gap: 8px;
}

.detail-panel {
  width: min(620px, calc(100% - 32px));
}

.detail-body {
  display: grid;
  gap: 16px;
}

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

.detail-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #11100e;
}

.detail-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.detail-item strong {
  overflow-wrap: anywhere;
}

.detail-error {
  min-width: 0;
  border: 1px solid #6d4037;
  border-radius: 8px;
  padding: 14px;
  background: #1f1310;
}

.detail-error p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-error strong {
  display: block;
  margin-bottom: 8px;
}

.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #8e918f;
  border-radius: 8px;
  background: #131314;
  color: #e3e3e3;
  font-family: Roboto, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.43;
}

.google-button:hover {
  background: #1f1f1f;
}

.google-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.auth-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11100e;
  color: var(--ink);
}

@media (max-width: 860px) {
  .topbar {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .credit-options {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .active-job {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .active-job .status {
    grid-column: 1;
    grid-row: 2;
  }

  .active-job-progress {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .active-job > button {
    grid-column: 2;
    grid-row: 1;
  }

  .history-job {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .history-job time {
    grid-column: 1;
    grid-row: 2;
  }

  .history-job .status {
    grid-column: 1;
    grid-row: 3;
  }

  .history-job > button {
    grid-column: 2;
    grid-row: 1 / 4;
  }
}

@media (max-width: 560px) {
  .section {
    width: min(100% - 28px, 1160px);
    padding: 36px 0;
  }

  .topbar {
    padding-inline: 14px;
  }

  .nav {
    gap: 10px;
    font-size: 0.88rem;
  }

  h1 {
    font-size: 2.55rem;
  }

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

  .dashboard-section .section-heading h2 {
    font-size: 2rem;
  }

  .stats article {
    padding: 12px 10px;
  }

  .stats span {
    font-size: 0.7rem;
  }

  .stats strong {
    font-size: 1.35rem;
  }

  .active-job,
  .history-job {
    gap: 14px;
  }

  .estimate {
    align-items: stretch;
    flex-direction: column;
  }
}
