html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
}

body {
  min-height: 100%;
  margin-bottom: 60px;
  background: #f6f8f5;
  color: #202124;
}

.navbar {
  background: #ffffff;
}

.navbar-brand {
  color: #176b68;
}

.container {
  max-width: 1240px;
}

.public-page {
  margin-bottom: 0;
  background: #f8faf7;
}

.public-navbar {
  margin-bottom: 0;
}

.public-container {
  width: 100%;
}

.public-container main {
  padding-bottom: 0 !important;
}

.public-hero {
  min-height: calc(100vh - 58px);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(2rem, 5vw, 5rem) max(1.25rem, calc((100vw - 1240px) / 2));
  background:
    linear-gradient(135deg, rgba(20, 73, 77, 0.98), rgba(23, 107, 104, 0.96) 52%, rgba(46, 87, 105, 0.98)),
    #176b68;
  color: #ffffff;
}

.public-hero h1 {
  max-width: 790px;
  margin: 0.25rem 0 1rem;
  font-size: clamp(2.55rem, 5.8vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.public-hero .eyebrow {
  color: #f2c15d;
}

.public-hero-copy {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  line-height: 1.55;
}

.public-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.public-actions .btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 800;
}

.btn-outline-light:hover {
  color: #14494d;
}

.public-product-shot {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #ffffff;
  color: #202124;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.product-window-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #dce2e8;
  background: #eef2ef;
}

.product-window-bar span {
  width: 0.72rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #d65c5c;
}

.product-window-bar span:nth-child(2) {
  background: #f2c15d;
}

.product-window-bar span:nth-child(3) {
  background: #36a583;
}

.product-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 1rem;
  padding: clamp(1rem, 2.4vw, 1.5rem);
}

.product-preview-main {
  display: grid;
  gap: 0.75rem;
}

.preview-kicker,
.product-preview-side span {
  color: #176b68;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.product-preview-main h2 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.preview-line,
.preview-total,
.product-preview-side div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  background: #fbfcfb;
}

.preview-total {
  align-items: center;
  background: #152f33;
  color: #ffffff;
  border-color: #152f33;
}

.preview-total strong {
  font-size: 1.35rem;
}

.product-preview-side {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.product-preview-side div {
  display: grid;
  min-height: 95px;
  align-content: space-between;
}

.product-preview-side strong {
  color: #202124;
}

.public-band,
.public-cta {
  padding: clamp(2.2rem, 5vw, 5rem) max(1.25rem, calc((100vw - 1240px) / 2));
}

.public-section-heading {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1.4rem;
}

.public-section-heading h2,
.public-cta h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0;
}

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

.public-feature-card {
  min-height: 260px;
  padding: 1.25rem;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(32, 33, 36, 0.08);
}

.feature-number {
  display: inline-flex;
  color: #b24b5a;
  font-weight: 900;
}

.public-feature-card h3 {
  margin: 1.7rem 0 0.65rem;
  font-size: 1.45rem;
}

.public-feature-card p {
  color: #4d555d;
  line-height: 1.55;
}

.public-trades-strip {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1.1rem max(1.25rem, calc((100vw - 1240px) / 2));
  background: #152f33;
}

.public-trades-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #ffffff;
  font-weight: 750;
}

.public-cta {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
  background: #ffffff;
}

.auth-shell {
  min-height: calc(100vh - 170px);
  display: grid;
  place-items: center;
  padding: 2rem 0;
}

.auth-panel {
  width: min(100%, 430px);
  background: #ffffff;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(32, 33, 36, 0.08);
  padding: 1.5rem;
}

.auth-panel-wide {
  width: min(100%, 680px);
}

.auth-panel h1 {
  margin: 0.2rem 0 0.55rem;
  font-size: 2rem;
}

.nav-user {
  font-weight: 700;
}

.page-heading {
  margin: 1.4rem 0 1.2rem;
}

.page-heading h1 {
  margin: 0.1rem 0;
  font-size: clamp(2rem, 4vw, 3.75rem);
  line-height: 1;
  letter-spacing: 0;
}

.page-heading p:last-child {
  max-width: 740px;
  color: #626a73;
  margin-bottom: 0;
}

.page-actions,
.preview-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.preview-toolbar {
  justify-content: flex-end;
}

.eyebrow {
  margin: 0;
  color: #176b68;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

.metric-card,
.panel,
.quote-line-editor {
  background: #ffffff;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(32, 33, 36, 0.08);
}

.metric-card {
  padding: 1rem;
}

.metric-link {
  color: inherit;
  display: block;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.metric-link:hover,
.metric-link:focus {
  border-color: #176b68;
  box-shadow: 0 20px 48px rgba(23, 107, 104, 0.16);
  color: inherit;
  transform: translateY(-1px);
}

.metric-card span {
  display: block;
  color: #626a73;
  font-weight: 650;
}

.metric-card strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.7rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 1rem;
  align-items: start;
}

.panel {
  padding: 1.1rem;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.panel-title h2 {
  margin: 0;
  font-size: 1.25rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef8f6;
  color: #176b68;
  padding: 0.28rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.list-stack {
  display: grid;
  gap: 0.65rem;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  color: #202124;
  text-decoration: none;
  background: #fbfcfb;
}

.list-row:hover {
  border-color: #176b68;
}

.list-row small {
  display: block;
  color: #626a73;
}

.scope-text {
  color: #4d555d;
  line-height: 1.55;
  margin: 0;
}

.quote-lines {
  display: grid;
  gap: 1rem;
}

.quote-header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 0.8rem;
}

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

.add-line-grid {
  display: grid;
  grid-template-columns: 160px repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.wide-field {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.setup-tabs {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.company-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.25rem;
  align-items: start;
}

.logo-upload-panel {
  border: 1px solid #dce2e8;
  border-radius: 8px;
  padding: 1rem;
  background: #fbfcfb;
}

.logo-upload-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.company-logo-preview,
.document-logo {
  display: block;
  max-width: 210px;
  max-height: 90px;
  object-fit: contain;
}

.company-logo-preview {
  padding: 0.5rem;
  background: #ffffff;
  border: 1px solid #dce2e8;
  border-radius: 8px;
}

.logo-placeholder {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed #aab3bb;
  border-radius: 8px;
  color: #626a73;
  background: #ffffff;
  font-weight: 700;
}

.checkbox-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.2rem 0.55rem;
  min-height: 44px;
}

.checkbox-field input {
  width: 18px;
  aspect-ratio: 1;
  margin-top: 0.2rem;
}

.checkbox-field .field-hint {
  grid-column: 2;
  margin-top: 0;
}

.row-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.quote-line-editor {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  box-shadow: none;
}

.line-header,
.line-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.line-number-grid {
  display: grid;
  grid-template-columns: 0.6fr 0.7fr repeat(3, 1fr);
  gap: 0.7rem;
}

label {
  color: #394147;
  font-weight: 700;
}

.required-marker {
  color: #b24b5a;
  font-weight: 900;
}

.field-hint {
  display: block;
  margin-top: 0.25rem;
  color: #626a73;
  font-weight: 500;
}

.form-control,
.form-select {
  margin-top: 0.25rem;
}

.btn-primary {
  background: #176b68;
  border-color: #176b68;
}

.btn-primary:hover {
  background: #0d4d4b;
  border-color: #0d4d4b;
}

.quote-document {
  max-width: 960px;
  margin: 1.5rem auto 3rem;
  padding: 2rem;
  background: #ffffff;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(32, 33, 36, 0.08);
}

.quote-doc-header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #202124;
}

.quote-doc-header h1,
.quote-doc-title h2 {
  margin: 0.15rem 0 0.45rem;
  letter-spacing: 0;
}

.quote-doc-header p,
.quote-doc-grid p,
.quote-doc-section p,
.quote-doc-footer p {
  color: #4d555d;
  line-height: 1.55;
  margin: 0.2rem 0;
}

.quote-doc-header span + span::before {
  content: " | ";
  color: #8a929a;
}

.document-logo {
  margin-bottom: 0.9rem;
}

.quote-doc-title {
  text-align: right;
}

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

.quote-doc-grid h2,
.quote-doc-section h2,
.quote-doc-footer h2 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  color: #176b68;
}

.quote-doc-name {
  color: #202124 !important;
  font-weight: 800;
}

.quote-doc-section {
  padding: 1.25rem 0;
  border-top: 1px solid #dce2e8;
}

.quote-preview-table {
  margin-bottom: 0;
}

.quote-preview-table th {
  color: #394147;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.quote-preview-table td {
  vertical-align: top;
}

.quote-preview-table td span {
  display: block;
  color: #4d555d;
  margin-top: 0.15rem;
}

.quote-totals {
  display: grid;
  gap: 0.35rem;
  max-width: 360px;
  margin-left: auto;
  padding-top: 1rem;
  border-top: 1px solid #dce2e8;
}

.quote-totals div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.quote-totals span {
  color: #626a73;
  font-weight: 700;
}

.quote-total-row {
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 2px solid #202124;
  font-size: 1.15rem;
}

.quote-doc-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #dce2e8;
}

.invoice-brand-block {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #dce2e8;
}

.invoice-brand-block h2 {
  margin: 0 0 0.3rem;
  font-size: 1.25rem;
}

.invoice-brand-block p {
  margin: 0.15rem 0;
  color: #4d555d;
}

.invoice-brand-block span + span::before {
  content: " | ";
  color: #8a929a;
}

.invoice-brand-meta {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 0.2rem;
  min-width: 190px;
  color: #4d555d;
}

.invoice-brand-meta strong {
  color: #202124;
  font-size: 1.2rem;
}

@media (max-width: 900px) {
  .public-hero,
  .product-preview-grid,
  .public-feature-grid {
    grid-template-columns: 1fr;
  }

  .public-hero {
    min-height: auto;
  }

  .public-cta {
    display: grid;
  }

  .metric-grid,
  .content-grid,
  .form-grid,
  .add-line-grid,
  .quote-header-grid,
  .line-number-grid,
  .quote-doc-header,
  .quote-doc-grid,
  .company-profile-grid {
    grid-template-columns: 1fr;
  }

  .quote-doc-title {
    text-align: left;
  }

  .invoice-brand-block {
    display: grid;
  }

  .invoice-brand-meta {
    justify-items: start;
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

@media print {
  html {
    font-size: 12px;
  }

  body {
    margin: 0;
    background: #ffffff;
    color: #202124;
  }

  .navbar,
  footer,
  .no-print {
    display: none !important;
  }

  .container {
    max-width: none;
    width: 100%;
    padding: 0;
  }

  main {
    padding: 0 !important;
  }

  .quote-document {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .quote-doc-footer {
    display: block !important;
  }

  .table-responsive {
    overflow: visible;
  }

  .quote-preview-table tr,
  .quote-doc-section,
  .quote-doc-footer {
    break-inside: avoid;
  }
}
