/* ================================
   PREMIUM FLOORING COST ESTIMATOR
   COMPLETE STYLE.CSS
================================ */

:root {
  --color-primary: #16352f;
  --color-primary-dark: #0f2924;
  --color-primary-light: #e9f2ef;

  --color-accent: #c99a4b;
  --color-accent-dark: #a9772f;
  --color-accent-light: #f6ead5;

  --color-background: #f4f1eb;
  --color-surface: #ffffff;
  --color-surface-soft: #f8f7f3;

  --color-text: #1d2926;
  --color-text-soft: #66736f;
  --color-border: #dce3df;
  --color-border-dark: #c6d0cc;

  --color-success: #2f7d62;
  --color-success-light: #e9f5f0;

  --color-danger: #b84c4c;
  --color-shadow: rgba(18, 47, 40, 0.12);

  --radius-small: 10px;
  --radius-medium: 16px;
  --radius-large: 24px;

  --shadow-small: 0 8px 24px rgba(18, 47, 40, 0.08);
  --shadow-medium: 0 18px 45px rgba(18, 47, 40, 0.12);
  --shadow-large: 0 28px 70px rgba(18, 47, 40, 0.16);
}

/* ================================
   GLOBAL RESET
================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(201, 154, 75, 0.12), transparent 34%),
    linear-gradient(180deg, #f7f4ee 0%, var(--color-background) 100%);
  color: var(--color-text);
  font-family:
    Inter,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
select,
label {
  cursor: pointer;
}

input,
select,
button {
  outline: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* ================================
   PAGE CONTAINER
================================ */

.estimator-page {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 24px;
}

/* ================================
   HERO SECTION
================================ */

.hero-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  margin-bottom: 28px;
  padding: 38px 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-large);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent),
    linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  box-shadow: var(--shadow-large);
  color: #ffffff;
}

.hero-section::before {
  position: absolute;
  top: -90px;
  right: -70px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.hero-section::after {
  position: absolute;
  right: 120px;
  bottom: -150px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(201, 154, 75, 0.08);
  content: "";
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  max-width: 880px;
}

.hero-icon {
  display: grid;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-accent);
  font-size: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.eyebrow {
  margin-bottom: 8px;
  color: #ead3a7;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-section h1 {
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 4vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.hero-description {
  max-width: 760px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.02rem;
  line-height: 1.75;
}

.hero-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  backdrop-filter: blur(10px);
}

.badge-dot,
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #77d3ab;
  box-shadow: 0 0 0 5px rgba(119, 211, 171, 0.12);
}

/* ================================
   MAIN LAYOUT
================================ */

.estimator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
  align-items: start;
  gap: 28px;
}

.form-panel,
.results-panel {
  border: 1px solid rgba(22, 53, 47, 0.08);
  border-radius: var(--radius-large);
  background: var(--color-surface);
  box-shadow: var(--shadow-medium);
}

.form-panel {
  padding: 34px;
}

.results-panel {
  position: sticky;
  top: 24px;
  padding: 30px;
}

/* ================================
   PANEL HEADERS
================================ */

.panel-header,
.results-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.panel-header {
  margin-bottom: 28px;
}

.panel-header > div,
.results-panel-header > div {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.section-number {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.panel-header h2,
.results-panel-header h2 {
  padding-top: 3px;
  color: var(--color-primary-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  line-height: 1.2;
}

.panel-header > p {
  max-width: 330px;
  color: var(--color-text-soft);
  font-size: 0.9rem;
  line-height: 1.65;
}

.estimate-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--color-success-light);
  color: var(--color-success);
  font-size: 0.75rem;
  font-weight: 800;
}

/* ================================
   FORM SECTIONS
================================ */

.form-section {
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  background:
    linear-gradient(180deg, #ffffff 0%, #fcfcfa 100%);
}

.form-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 22px;
}

.section-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  font-size: 1rem;
  font-weight: 900;
}

.form-section-heading h3 {
  color: var(--color-primary-dark);
  font-size: 1rem;
  font-weight: 850;
}

.form-section-heading p {
  margin-top: 3px;
  color: var(--color-text-soft);
  font-size: 0.84rem;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.two-column-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 8px;
  color: #33413d;
  font-size: 0.84rem;
  font-weight: 800;
}

.required-mark {
  color: var(--color-danger);
}

.input-with-unit {
  position: relative;
}

input[type="number"],
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-small);
  background: #ffffff;
  color: var(--color-text);
  font-size: 0.94rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

input[type="number"] {
  padding: 0 92px 0 15px;
}

select {
  appearance: none;
  padding: 0 42px 0 15px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--color-primary) 50%),
    linear-gradient(135deg, var(--color-primary) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 21px,
    calc(100% - 12px) 21px;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
}

input[type="number"]:hover,
select:hover {
  border-color: #aabbb5;
}

input[type="number"]:focus,
select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(22, 53, 47, 0.09);
}

input[type="number"]::placeholder {
  color: #a4aeaa;
}

.input-unit {
  position: absolute;
  top: 50%;
  right: 14px;
  padding-left: 12px;
  border-left: 1px solid var(--color-border);
  color: var(--color-text-soft);
  font-size: 0.82rem;
  font-weight: 800;
  transform: translateY(-50%);
  pointer-events: none;
}

.field-help {
  margin-top: 8px;
  color: var(--color-text-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ================================
   SERVICE OPTIONS
================================ */

.service-options {
  display: grid;
  gap: 12px;
}

.service-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #ffffff;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.service-option:hover {
  border-color: #b8c7c2;
  background: #fcfdfc;
  box-shadow: 0 8px 22px rgba(18, 47, 40, 0.06);
  transform: translateY(-1px);
}

.service-option:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(22, 53, 47, 0.05);
}

.service-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.custom-checkbox {
  position: relative;
  width: 22px;
  height: 22px;
  border: 2px solid #afbbb7;
  border-radius: 6px;
  background: #ffffff;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.service-option input:checked + .custom-checkbox {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

.service-option input:checked + .custom-checkbox::after {
  position: absolute;
  top: 3px;
  left: 7px;
  width: 5px;
  height: 10px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  content: "";
  transform: rotate(45deg);
}

.service-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.service-title {
  color: var(--color-primary-dark);
  font-size: 0.89rem;
  font-weight: 850;
}

.service-description {
  margin-top: 4px;
  color: var(--color-text-soft);
  font-size: 0.77rem;
  line-height: 1.45;
}

.service-rate {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--color-surface-soft);
  color: var(--color-text-soft);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ================================
   FORM ACTIONS
================================ */

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
}

.secondary-button {
  min-height: 47px;
  padding: 0 19px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-small);
  background: #ffffff;
  color: var(--color-primary);
  font-size: 0.84rem;
  font-weight: 850;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.secondary-button:hover {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(22, 53, 47, 0.16);
  transform: translateY(-1px);
}

.secondary-button:active {
  transform: translateY(0);
}

.calculation-note {
  max-width: 330px;
  color: var(--color-text-soft);
  font-size: 0.78rem;
  text-align: right;
}

/* ================================
   TOTAL CARD
================================ */

.total-card {
  position: relative;
  overflow: hidden;
  margin-top: 24px;
  padding: 26px;
  border-radius: var(--radius-medium);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent),
    linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 41, 36, 0.2);
}

.total-card::after {
  position: absolute;
  top: -55px;
  right: -45px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(201, 154, 75, 0.12);
  content: "";
}

.total-label {
  position: relative;
  z-index: 1;
  color: #ead3a7;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.total-amount {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 5vw, 3.9rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.total-description {
  position: relative;
  z-index: 1;
  max-width: 410px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.8rem;
  line-height: 1.5;
}

.cost-per-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.cost-per-foot span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
}

.cost-per-foot strong {
  color: #ffffff;
  font-size: 1rem;
}

/* ================================
   RESULT GROUPS
================================ */

.results-group {
  margin-top: 24px;
}

.results-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.results-group-heading h3 {
  color: var(--color-primary-dark);
  font-size: 0.92rem;
  font-weight: 850;
}

.results-group-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 15px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: var(--color-surface-soft);
}

.highlighted-result-card {
  border-color: rgba(201, 154, 75, 0.4);
  background: var(--color-accent-light);
}

.result-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.result-label,
.breakdown-label {
  color: var(--color-primary-dark);
  font-size: 0.82rem;
  font-weight: 850;
}

.result-caption,
.breakdown-caption {
  margin-top: 2px;
  color: var(--color-text-soft);
  font-size: 0.71rem;
  line-height: 1.4;
}

.result-value {
  flex: 0 0 auto;
  color: var(--color-primary);
  font-size: 0.88rem;
  text-align: right;
}

/* ================================
   COST BREAKDOWN
================================ */

.breakdown-list {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #ffffff;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--color-border);
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.breakdown-row strong {
  flex: 0 0 auto;
  color: var(--color-primary-dark);
  font-size: 0.88rem;
}

/* ================================
   GRAND TOTAL
================================ */

.grand-total-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding: 20px;
  border: 1px solid rgba(201, 154, 75, 0.35);
  border-radius: var(--radius-medium);
  background:
    linear-gradient(135deg, #fffaf0, var(--color-accent-light));
}

.grand-total-label {
  color: var(--color-primary-dark);
  font-size: 0.95rem;
  font-weight: 900;
}

.grand-total-card p {
  margin-top: 4px;
  color: var(--color-text-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.grand-total-card strong {
  flex: 0 0 auto;
  color: var(--color-primary-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
}

/* ================================
   DISCLAIMER
================================ */

.estimate-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 13px 14px;
  border-radius: var(--radius-small);
  background: #f4f6f5;
}

.disclaimer-icon {
  display: grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: #ffffff;
  font-family: Georgia, serif;
  font-size: 0.72rem;
  font-weight: 700;
}

.estimate-disclaimer p {
  color: var(--color-text-soft);
  font-size: 0.69rem;
  line-height: 1.55;
}

/* ================================
   FOOTER
================================ */

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 8px 0;
  color: var(--color-text-soft);
  font-size: 0.75rem;
}

.app-footer p {
  color: var(--color-primary);
  font-weight: 850;
}

/* ================================
   ACCESSIBILITY
================================ */

button:focus-visible,
input:focus-visible,
select:focus-visible,
.service-option:has(input:focus-visible) {
  outline: 3px solid rgba(201, 154, 75, 0.38);
  outline-offset: 3px;
}

/* ================================
   TABLET RESPONSIVE
================================ */

@media (max-width: 1120px) {
  .estimator-layout {
    grid-template-columns: 1fr;
  }

  .results-panel {
    position: static;
  }

  .panel-header > p {
    max-width: 380px;
  }
}

/* ================================
   SMALL TABLET RESPONSIVE
================================ */

@media (max-width: 760px) {
  .estimator-page {
    width: min(100% - 24px, 1500px);
    padding-top: 18px;
  }

  .hero-section {
    align-items: flex-start;
    flex-direction: column;
    padding: 30px 24px;
  }

  .hero-content {
    flex-direction: column;
    gap: 16px;
  }

  .hero-section h1 {
    font-size: clamp(2.05rem, 9vw, 3.2rem);
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .form-panel,
  .results-panel {
    padding: 22px;
  }

  .panel-header,
  .results-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-header > p {
    max-width: none;
  }

  .two-column-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .secondary-button {
    width: 100%;
  }

  .calculation-note {
    max-width: none;
    text-align: left;
  }

  .service-option {
    grid-template-columns: auto 1fr;
  }

  .service-rate {
    grid-column: 2;
    justify-self: start;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

/* ================================
   MOBILE RESPONSIVE
================================ */

@media (max-width: 520px) {
  .estimator-page {
    width: min(100% - 16px, 1500px);
    padding-top: 10px;
  }

  .hero-section {
    margin-bottom: 16px;
    padding: 26px 20px;
    border-radius: 20px;
  }

  .hero-icon {
    width: 50px;
    height: 50px;
  }

  .eyebrow {
    font-size: 0.68rem;
  }

  .hero-section h1 {
    font-size: 2.05rem;
    line-height: 1.08;
  }

  .hero-description {
    font-size: 0.87rem;
    line-height: 1.65;
  }

  .hero-badge {
    font-size: 0.74rem;
  }

  .estimator-layout {
    gap: 16px;
  }

  .form-panel,
  .results-panel {
    padding: 16px;
    border-radius: 20px;
  }

  .form-section {
    padding: 18px 15px;
  }

  .form-section-heading {
    gap: 10px;
  }

  .section-icon {
    width: 34px;
    height: 34px;
  }

  .panel-header h2,
  .results-panel-header h2 {
    font-size: 1.42rem;
  }

  .service-option {
    padding: 14px;
  }

  .total-card {
    padding: 22px 18px;
  }

  .total-amount {
    font-size: 2.65rem;
  }

  .cost-per-foot,
  .grand-total-card,
  .result-card,
  .breakdown-row {
    align-items: flex-start;
  }

  .cost-per-foot {
    flex-direction: column;
    gap: 5px;
  }

  .result-card,
  .breakdown-row,
  .grand-total-card {
    flex-direction: column;
  }

  .result-value,
  .breakdown-row strong,
  .grand-total-card strong {
    text-align: left;
  }

  .grand-total-card strong {
    font-size: 1.8rem;
  }
}