/* =========================================================
   The Rare Pull — Stylesheet
   Edit the CSS variables below to drop in your real brand
   colors. Fonts are loaded from Google Fonts in each page's
   <head> (Baloo 2 for headings, Inter for body text) — swap
   the <link> tags there if you pick different fonts.
   ========================================================= */

:root {
  /* --- Brand colors, matched to the TRP logo --- */
  --primary-color: #14142b;       /* deep navy background */
  --primary-color-dark: #0b0a1c;
  --secondary-color: #f2a900;     /* gold ("P") */
  --secondary-color-dark: #cf8f00;
  --accent-color: #e5473c;        /* red ("T") — also used for alerts/errors */
  --stripe-blue: #3d63d6;         /* blue end of the logo's gradient stripe */

  /* --- Neutrals --- */
  --color-bg: #faf9fc;
  --color-surface: #ffffff;
  --color-text: #1c1a24;
  --color-text-muted: #5c5870;
  --color-border: #e4e1ee;

  /* --- Typography --- */
  --font-heading: "Baloo 2", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  /* --- Layout --- */
  --max-width: 1100px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(28, 20, 64, 0.08);
  --shadow-md: 0 8px 24px rgba(28, 20, 64, 0.12);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--primary-color);
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0;
  padding: 0;
}

button {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85em 1.8em;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--secondary-color);
  color: var(--primary-color-dark);
}

.btn-primary:hover {
  background: var(--secondary-color-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--color-surface);
  border-color: var(--color-surface);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: #fff;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--primary-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, var(--accent-color), var(--stripe-blue)) 1;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-brand img {
  height: 38px;
  width: 38px;
}

.nav-brand span {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  color: #fff;
  font-weight: 600;
  opacity: 0.85;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
  text-decoration: none;
  border-bottom-color: var(--secondary-color);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-color);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .nav-links.open {
    max-height: 400px;
  }

  .nav-links li {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .nav-links a {
    display: block;
    padding: 1rem 1.5rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--primary-color), var(--primary-color-dark));
  color: #fff;
  text-align: center;
  padding: 5rem 1.5rem 4.5rem;
}

.hero img.hero-logo {
  height: 96px;
  width: 96px;
  margin: 0 auto 1.5rem;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.75rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.15rem;
  max-width: 640px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Sections ---------- */
.section {
  padding: 4rem 1.5rem;
}

.section-alt {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-intro {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 620px;
  margin: 0 auto 2.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.card h3 {
  font-size: 1.15rem;
}

.card .card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

/* ---------- Page header (non-home pages) ---------- */
.page-header {
  background: var(--primary-color);
  color: #fff;
  padding: 3rem 1.5rem;
  text-align: center;
}

.page-header h1 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* ---------- Calculator ---------- */
.calculator {
  max-width: 640px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
}

.calculator label {
  font-weight: 600;
}

.calc-intro {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.calc-categories {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.calc-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.calc-category-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.calc-category-info label {
  font-family: var(--font-heading);
  color: var(--color-text);
}

.calc-category-rate {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.calc-category-row input[type="number"] {
  width: 110px;
  font-size: 1.25rem;
  font-family: var(--font-heading);
  padding: 0.5em 0.75em;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  text-align: right;
  transition: border-color 0.15s ease;
}

.calc-category-row input[type="number"]:focus {
  border-color: var(--secondary-color);
}

.calculator .field-error {
  color: var(--accent-color);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.calc-result {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px dashed var(--color-border);
}

.calc-total {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  color: var(--primary-color);
  margin: 0;
}

.calc-total .calc-total-unit {
  font-size: 1rem;
  color: var(--color-text-muted);
  font-family: var(--font-body);
}

.calc-breakdown {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-top: 0.4rem;
}

.calc-breakdown p {
  margin: 0 0 0.3rem;
}

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

.calc-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary-color);
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ---------- About ---------- */
.about-content {
  max-width: 720px;
  margin: 0 auto;
}

.about-content h2 {
  text-align: left;
}

/* ---------- Contact form ---------- */
.contact-form {
  max-width: 560px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75em 1em;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--secondary-color);
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

.form-error {
  color: var(--accent-color);
  font-size: 0.85rem;
  margin-top: 0.35rem;
  min-height: 1.1em;
}

.form-success {
  background: rgba(46, 160, 90, 0.12);
  border: 1px solid rgba(46, 160, 90, 0.4);
  color: #1c7a41;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: none;
}

.form-success.visible {
  display: block;
}

/* ---------- FAQ Accordion ---------- */
.accordion {
  max-width: 720px;
  margin: 0 auto;
}

.accordion-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.9rem;
  overflow: hidden;
  background: var(--color-surface);
}

.accordion-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: none;
  border: none;
  text-align: left;
  padding: 1.1rem 1.4rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
}

.accordion-icon {
  flex-shrink: 0;
  font-size: 1.3rem;
  color: var(--secondary-color);
  transition: transform 0.2s ease;
}

.accordion-item.open .accordion-icon {
  transform: rotate(45deg);
}

.accordion-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.accordion-answer p {
  padding: 0 1.4rem 1.2rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--primary-color-dark);
  color: rgba(255, 255, 255, 0.75);
  padding: 2.5rem 1.5rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-brand img {
  height: 28px;
  width: 28px;
}

.footer-brand span {
  font-family: var(--font-heading);
  color: #fff;
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.75);
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 1.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Utility ---------- */
.text-center {
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
