/* ================================================================
   Oddy's Logistics — Premium Dark / Gold / Purple
   Secret-society subtle. Compass rose. Cartographic elegance.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Raleway:wght@300;400;500;600&display=swap');

:root {
  /* Gold spectrum */
  --gold-light: #f0d878;
  --gold: #c9a84c;
  --gold-dark: #8a6d2b;
  --gold-deep: #5c4a1e;

  /* Purple spectrum */
  --purple-light: #b388ff;
  --purple: #7c4dff;
  --purple-dark: #4a2d8a;
  --purple-deep: #1e1040;

  /* Foundations */
  --bg: #08060e;
  --bg-warm: #0c0a12;
  --surface: #110e1a;
  --surface-raised: #171324;

  --text: #e8e0d0;
  --text-muted: #9e917e;
  --text-dim: #6b6058;

  /* Functional */
  --accent: var(--gold);
  --accent-glow: rgba(201, 168, 76, 0.15);
  --purple-glow: rgba(124, 77, 255, 0.08);
  --border: rgba(201, 168, 76, 0.12);
  --border-subtle: rgba(201, 168, 76, 0.06);

  --radius: 12px;
  --radius-lg: 20px;
  --maxw: 420px;
  --pad: 20px;
  --gap: 16px;
}

/* -------- Reset -------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Raleway', sans-serif;
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;

  background: var(--bg);

  /* Layered atmosphere */
  background-image:
    /* Top-centre warm glow — like lamplight on old parchment */
    radial-gradient(
      600px 350px at 50% 0%,
      rgba(201, 168, 76, 0.08),
      transparent 70%
    ),

    /* Faint purple nebula — bottom-right */
    radial-gradient(
      800px 600px at 80% 100%,
      rgba(124, 77, 255, 0.04),
      transparent 60%
    ),

    /* Subtle noise texture via repeating gradient */
    repeating-conic-gradient(
      rgba(255,255,255,0.008) 0% 25%,
      transparent 0% 50%
    );
}

/* Faint compass-rose watermark on body — secret society touch */
body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 800px;
  transform: translate(-50%, -50%);
  opacity: 0.012;
  background: conic-gradient(
    from 0deg,
    var(--gold) 0deg 2deg,
    transparent 2deg 88deg,
    var(--gold) 88deg 92deg,
    transparent 92deg 178deg,
    var(--gold) 178deg 182deg,
    transparent 182deg 268deg,
    var(--gold) 268deg 272deg,
    transparent 272deg 360deg
  );
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* -------- Layout -------- */
header, main, footer {
  position: relative;
  z-index: 1;
  width: min(100%, var(--maxw));
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* -------- Header / Logo -------- */
header {
  padding-top: 28px;
  padding-bottom: 8px;
  text-align: center;
}

.logo {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto;
  /* Subtle gold glow behind logo */
  filter: drop-shadow(0 0 30px rgba(201, 168, 76, 0.15));
}

/* Decorative line under header — thin gold rule with diamond */
header::after {
  content: "\u25C7";
  display: block;
  margin: 16px auto 0;
  font-size: 8px;
  letter-spacing: 0;
  color: var(--gold-dark);
  text-align: center;
  line-height: 1;
  position: relative;
}

header::after {
  content: "";
  display: block;
  width: 160px;
  height: 1px;
  margin: 20px auto 0;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold-dark),
    var(--gold),
    var(--gold-dark),
    transparent
  );
}

/* -------- Section card -------- */
section {
  position: relative;
  margin-top: 8px;
  padding: 28px 24px;
  border-radius: var(--radius-lg);

  /* Dark surface with very subtle gold edge */
  background:
    linear-gradient(
      180deg,
      rgba(201, 168, 76, 0.03) 0%,
      transparent 40%
    ),
    var(--surface);

  border: 1px solid var(--border);

  /* Layered shadow — depth without heaviness */
  box-shadow:
    0 1px 0 0 rgba(201, 168, 76, 0.04) inset,
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Faint inner border glow — like gilded edge of a leather-bound book */
section::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius-lg) - 1px);
  border: 1px solid rgba(201, 168, 76, 0.04);
  pointer-events: none;
}

/* -------- Typography -------- */
h2 {
  margin: 0 0 18px;
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  /* Faint gold text-shadow for engraved feel */
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
}

.intro {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 300;
  margin: 0 0 20px;
  letter-spacing: 0.3px;
}

p {
  margin: 0 0 12px;
}

/* -------- Form -------- */
form {
  display: grid;
  gap: var(--gap);
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

input[type="text"],
input[type="datetime-local"],
select {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-family: 'Raleway', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]::placeholder {
  color: var(--text-dim);
  font-weight: 300;
}

input[type="text"]:focus,
input[type="datetime-local"]:focus,
select:focus {
  outline: none;
  border-color: var(--gold-dark);
  box-shadow:
    0 0 0 3px rgba(201, 168, 76, 0.1),
    0 0 20px rgba(201, 168, 76, 0.05);
}

/* datetime-local dark mode */
input[type="datetime-local"] {
  color-scheme: dark;
}

/* Select dropdown arrow */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239e917e' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

/* Checkbox */
label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: none;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: border-color 0.2s;
}

label:has(input[type="checkbox"]):hover {
  border-color: var(--border);
}

label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* -------- Button -------- */
button, .cta-link {
  display: inline-block;
  padding: 14px 24px;
  border: 1px solid var(--gold-dark);
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    var(--gold) 0%,
    var(--gold-dark) 100%
  );
  color: #0a0806;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;

  box-shadow:
    0 0 30px rgba(201, 168, 76, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.4);

  transition: filter 0.15s, transform 0.1s, box-shadow 0.2s;
}

button:hover, .cta-link:hover {
  filter: brightness(1.1);
  box-shadow:
    0 0 40px rgba(201, 168, 76, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.4);
}

button:active, .cta-link:active {
  transform: translateY(1px);
  filter: brightness(0.95);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

/* -------- Result / Error display -------- */
#result, #formError {
  margin-top: 14px;
  min-height: 0;
}

.result-error {
  color: #e07c6c;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(224, 124, 108, 0.15);
  background: rgba(224, 124, 108, 0.05);
}

/* -------- Small print -------- */
small {
  display: block;
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.2px;
  line-height: 1.6;
}

/* -------- Quote result header -------- */

.quote-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.quote-route {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 1rem;
}

.route-label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quote-route strong {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.route-arrow {
  color: var(--gold-dark);
  font-size: 1rem;
}

.quote-detail {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 300;
}

.quote-delivery {
  color: var(--text-muted);
}

.quote-delivery strong {
  color: var(--gold);
}

/* -------- Quote breakdown -------- */

.breakdown {
  display: grid;
  gap: 10px;
  font-size: 0.9rem;
}

.breakdown hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 4px 0;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  color: var(--text-muted);
}

.breakdown-row span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text);
  font-weight: 500;
}

.breakdown-total {
  font-size: 1.2rem;
  font-weight: 700;
  padding-top: 6px;
}

.breakdown-total span:first-child {
  font-family: 'Cinzel', serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
}

.breakdown-total span:last-child {
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

.breakdown-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  font-weight: 300;
}

.breakdown-mock {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(124, 77, 255, 0.06);
  border: 1px solid rgba(124, 77, 255, 0.12);
  font-style: normal;
  font-size: 0.78rem;
  color: var(--purple-light);
}

/* -------- Footer -------- */
footer {
  padding: 32px var(--pad) 28px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.3px;
}

footer::before {
  content: "";
  display: block;
  width: 80px;
  height: 1px;
  margin: 0 auto 20px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold-deep),
    transparent
  );
}

footer a {
  color: var(--gold-dark);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--gold);
}

footer p {
  margin: 0 0 8px;
  line-height: 1.7;
}

/* -------- Loading state -------- */
#loading .intro::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--gold-dark);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* -------- Responsive -------- */
@media (min-width: 480px) {
  :root { --maxw: 460px; }
  section { padding: 32px 28px; }
}

@media (min-width: 768px) {
  :root { --maxw: 480px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
