html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.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;
}

:root {
  color-scheme: dark;
  --tbt-navy: #071a33;
  --tbt-navy-secondary: #0b2342;
  --tbt-navy-dark: #102d50;
  --tbt-black: #03070c;
  --tbt-gold: #c9a86a;
  --tbt-gold-light: #e4cb91;
  --tbt-cream: #f7f2e8;
  --tbt-muted: #8f9bad;
}

html { scroll-behavior: smooth; }
body {
  color: var(--tbt-cream);
  background:
    radial-gradient(ellipse at 85% 0%, rgba(16, 45, 80, .35), transparent 42%),
    linear-gradient(145deg, var(--tbt-black), var(--tbt-navy) 58%, #061426);
  overflow-x: hidden;
}

a { text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--tbt-gold-light);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(201, 168, 106, .16);
}

button, .btn, .pipeline-button, .delivery-submit, .order-btn,
.login-btn, .register-btn, .measurement-btn {
  transition: color 180ms ease, background-color 180ms ease,
    border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
button:not(:disabled):hover, .btn:not(:disabled):hover,
.pipeline-button:hover, .delivery-submit:hover, .order-btn:hover,
.login-btn:hover, .register-btn:hover, .measurement-btn:hover {
  box-shadow: 0 10px 25px rgba(201, 168, 106, .12);
}
button:disabled, .btn:disabled, [aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .6;
  box-shadow: none;
}

input.form-control, select.form-select, textarea.form-control {
  border-color: rgba(201, 168, 106, .3);
  color: var(--tbt-cream);
  background-color: rgba(11, 35, 66, .92);
}
input.form-control:focus, select.form-select:focus, textarea.form-control:focus {
  border-color: var(--tbt-gold);
  color: var(--tbt-cream);
  background-color: #0b2342;
  box-shadow: 0 0 0 .22rem rgba(201, 168, 106, .16);
}
input.form-control::placeholder, textarea.form-control::placeholder { color: var(--tbt-muted); }

.home-particle-page { position: relative; isolation: isolate; overflow: clip; }
.home-ambient-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.home-particle-page > :not(.home-ambient-canvas) { position: relative; z-index: 1; }
.home-particle-page .products-section {
  background: linear-gradient(180deg, rgba(3, 7, 12, .82), rgba(3, 7, 12, .96));
}
.home-particle-page .product-card { box-shadow: 0 16px 34px rgba(0, 0, 0, .24); }
.home-particle-page .product-card:focus-visible {
  border-color: var(--tbt-gold-light);
  box-shadow: 0 0 0 3px rgba(201, 168, 106, .2), 0 18px 40px rgba(0, 0, 0, .4);
}

.auth-order-callout {
  margin-top: 22px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(201, 168, 106, .32);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(11, 35, 66, .9), rgba(7, 26, 51, .92));
  color: var(--tbt-cream);
}
.auth-order-callout p { margin: 0; color: #d3dae4; line-height: 1.7; }
.auth-order-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; }
.auth-create-account { color: var(--tbt-gold-light); font-weight: 650; }
.auth-create-account:hover { color: white; }

.customer-order-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(145px, .62fr);
  align-items: center;
  gap: 10px 20px;
}
.customer-design-options { min-width: 0; }
.customer-design-options .selection-group:last-child { margin-bottom: 0; }
.customer-design-preview { min-width: 0; }
.customer-design-actions { grid-column: 1 / -1; }
.customer-design-actions .order-btn { margin-top: 0; }

.measure-design-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, .42fr);
  align-items: center;
  gap: 18px;
}
.mini-trouser-preview {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(100%, 205px);
  margin: 0 auto;
  padding: 12px 10px;
  border: 1px solid rgba(201, 168, 106, .2);
  border-radius: 13px;
  background: linear-gradient(150deg, rgba(16, 45, 80, .48), rgba(3, 7, 12, .42));
}
.mini-trouser-image {
  display: block;
  width: min(100%, 142px);
  max-height: 300px;
  height: auto;
  object-fit: contain;
  opacity: 1;
  transition: opacity 180ms ease;
}
.mini-trouser-image.is-changing { opacity: .55; }
.mini-trouser-caption { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; color: var(--tbt-muted); font-size: 11px; text-align: center; }
.mini-trouser-caption [data-cut-label] { color: var(--tbt-gold-light); font-weight: 700; }

.delivery-character-count { color: var(--tbt-muted); font-size: 12px; white-space: nowrap; }
form[data-loading-text] button[type="submit"][aria-busy="true"] { opacity: .78; cursor: wait; }
.submit-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tbt-spin 700ms linear infinite;
}
@keyframes tbt-spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .auth-order-actions { align-items: stretch; flex-direction: column; }
  .auth-order-actions > * { width: 100%; text-align: center; }
  .customer-order-controls { grid-template-columns: minmax(0, 1fr) minmax(120px, .62fr); gap: 10px 14px; }
  .measure-design-summary { grid-template-columns: minmax(0, 1fr) 130px; gap: 12px; }
  .mini-trouser-preview { width: 100%; }
}
@media (max-width: 480px) {
  .customer-order-controls, .measure-design-summary { grid-template-columns: minmax(0, 1fr); }
  .customer-design-preview { grid-row: 2; }
  .customer-design-actions { grid-column: 1; }
  .mini-trouser-preview { width: min(100%, 205px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .home-ambient-canvas { display: none; }
}
