:root {
  --bg: #0b0b0d;
  --panel: #17171a;
  --panel-soft: #202024;
  --text: #f6f1e8;
  --muted: #b8b0a3;
  --gold: #c9a348;
  --gold-bright: #e4c464;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

body {
  background: linear-gradient(145deg, rgba(201, 163, 72, 0.12), transparent 32rem), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button,
input,
select { font: inherit; }

a { color: inherit; }

.estimate-shell {
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.topbar,
.estimate-card {
  margin: 0 auto;
  max-width: 760px;
  width: 100%;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.back-link,
.secondary-button,
.primary-button {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 46px;
  min-width: 0;
  padding: 10px 12px;
  text-decoration: none;
  text-align: center;
  white-space: normal;
}

.back-link,
.secondary-button {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--gold-bright);
}

.primary-button {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border: 0;
  color: #17120a;
}

.brand-block {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  background: #fff;
  border-radius: 8px;
  height: 48px;
  object-fit: cover;
  width: 48px;
}

.brand-kicker {
  color: var(--gold-bright);
  font-size: 0.76rem;
  font-weight: 800;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2 {
  letter-spacing: 0;
  line-height: 1.12;
  margin: 0;
}

h1 { font-size: 1.32rem; }
h2 { font-size: 1.5rem; }

.estimate-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.intro-block {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 16px;
}

.intro-block p:last-child {
  color: var(--muted);
  line-height: 1.5;
  margin: 10px 0 0;
}

.estimate-form,
.grid-two {
  display: grid;
  gap: 12px;
}

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

label {
  color: var(--muted);
  display: grid;
  font-size: 0.92rem;
  font-weight: 700;
  gap: 7px;
}

input,
select {
  background: #101013;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 48px;
  padding: 11px 12px;
  width: 100%;
}

.hidden { display: none !important; }

.result-panel {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 14px;
}

.result-line,
.result-total {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.result-line span { color: var(--muted); }

.result-total {
  border-top: 1px solid var(--line);
  color: var(--gold-bright);
  font-size: 1.2rem;
  font-weight: 900;
  padding-top: 10px;
}

.actions-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.status-line {
  color: var(--gold-bright);
  min-height: 1.4em;
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid-two,
  .actions-row {
    grid-template-columns: 1fr;
  }

  .estimate-card { padding: 14px; }
}

/* v3 clean estimate: customer/contact/address, detailed price rows and order buttons removed */
.compact-card {
  max-width: 620px;
}

.compact-intro {
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.compact-intro h2 {
  color: var(--gold-bright);
  font-size: 1.35rem;
}

.total-only {
  background: linear-gradient(135deg, rgba(228, 196, 100, 0.12), rgba(255, 255, 255, 0.04));
  margin-top: 18px;
  padding: 16px;
}

.clean-total {
  border-top: 0;
  font-size: 1.34rem;
  padding-top: 0;
}

.clean-total strong {
  font-size: 1.42rem;
}


/* v5: public estimate contact block */
.no-back-link {
  justify-content: flex-end;
}

.contact-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.call-button {
  align-items: center;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border: 0;
  border-radius: 8px;
  color: #17120a;
  display: flex;
  font-size: 1.1rem;
  font-weight: 900;
  justify-content: center;
  min-height: 52px;
  padding: 12px 14px;
  text-align: center;
  text-decoration: none;
}

.callback-panel {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.callback-panel p {
  color: var(--muted);
  font-weight: 800;
  margin: 0;
}

.callback-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.callback-row button {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border: 0;
  border-radius: 8px;
  color: #17120a;
  cursor: pointer;
  font-weight: 900;
  min-height: 48px;
  padding: 11px 14px;
  white-space: nowrap;
}

#callbackStatus {
  color: var(--gold-bright);
  min-height: 1.2em;
}

@media (max-width: 640px) {
  .no-back-link {
    align-items: flex-end;
  }

  .callback-row {
    grid-template-columns: 1fr;
  }

  .call-button,
  .callback-row button {
    width: 100%;
  }
}
