/* ============================================================
   A-TEX Roofing Referral Rewards Page
   Mobile-first responsive styles
   ============================================================ */

/* ----- Custom Properties ----- */
:root {
  --color-primary: #2ea3f2;
  --color-primary-dark: #1b7ec2;
  --color-cta: #e74c3c;
  --color-cta-hover: #c0392b;
  --color-heading: #222;
  --color-body: #555;
  --color-light-bg: #f8f9fa;
  --color-dark-bg: #1a1a2e;
  --color-white: #fff;
  --color-border: #e0e0e0;
  --color-success: #27ae60;
  --color-error: #e74c3c;
  --font-family: 'Open Sans', Arial, sans-serif;
  --container-max: 1140px;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --transition: 0.3s ease;
}

/* ----- Reset / Base ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-body);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  color: var(--color-primary-dark);
}

h1, h2, h3, h4 {
  color: var(--color-heading);
  line-height: 1.2;
}

ul {
  list-style: none;
}

/* ----- Utility ----- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--color-body);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn--cta {
  background: var(--color-cta);
  color: var(--color-white);
}

.btn--cta:hover {
  background: var(--color-cta-hover);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn--outline {
  background: transparent;
  color: var(--color-body);
  border: 2px solid var(--color-border);
  padding: 12px 24px;
}

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

.btn--full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.required {
  color: var(--color-error);
}

.hidden {
  display: none !important;
}

/* ----- Scroll Animations ----- */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   0. STICKY TOP BAR
   ============================================================ */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-white);
  height: 60px;
  transition: box-shadow var(--transition);
}

.top-bar--scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.top-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.top-bar__logo img {
  height: 36px;
  width: auto;
}

.top-bar__phone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--color-heading);
  white-space: nowrap;
}

.top-bar__phone:hover {
  color: var(--color-primary);
}

.top-bar__phone svg {
  flex-shrink: 0;
}

/* ============================================================
   1. HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 0 60px;
  background: url('../images/hero-bg.jpg') center/cover no-repeat;
  overflow: hidden;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.85) 0%, rgba(46, 163, 242, 0.6) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1rem;
}

.hero__headline {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 1rem;
  line-height: 1.15;
}

.hero__headline strong {
  color: #ffd700;
}

.hero__sub {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero__cta {
  font-size: 1.1rem;
  padding: 16px 40px;
}

.hero__trust {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ============================================================
   2. HOW IT WORKS
   ============================================================ */
.how-it-works {
  padding: 80px 0;
  background: var(--color-white);
}

.steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.step {
  text-align: center;
  max-width: 300px;
}

.step__icon {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 1rem;
  background: rgba(46, 163, 242, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step__number {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(46, 163, 242, 0.3);
}

.step__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step__desc {
  font-size: 0.95rem;
  color: var(--color-body);
}

.step__arrow {
  display: none;
}

/* ============================================================
   3. REWARD TIERS
   ============================================================ */
.rewards {
  padding: 80px 0;
  background: var(--color-light-bg);
}

.reward-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.reward-card {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.reward-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.reward-card__header {
  padding: 6px 0 0;
}

.reward-card--bronze .reward-card__header {
  border-top: 6px solid;
  border-image: linear-gradient(135deg, #b87333, #d4a574, #b87333) 1;
}

.reward-card--silver .reward-card__header {
  border-top: 6px solid;
  border-image: linear-gradient(135deg, #a8a8a8, #d4d4d4, #a8a8a8) 1;
}

.reward-card--gold .reward-card__header {
  border-top: 6px solid;
  border-image: linear-gradient(135deg, #d4a017, #ffd700, #d4a017) 1;
}

.reward-card--platinum .reward-card__header {
  border-top: 6px solid;
  border-image: linear-gradient(135deg, #6e7b8b, #b0c4de, #e8e8e8, #b0c4de, #6e7b8b) 1;
}

.reward-card--platinum {
  box-shadow: 0 4px 20px rgba(176, 196, 222, 0.4);
}

.reward-card__badge {
  position: absolute;
  top: 12px;
  right: -28px;
  background: var(--color-cta);
  color: var(--color-white);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 32px;
  transform: rotate(45deg);
}

.reward-card__tier {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-body);
}

.reward-card__body {
  padding: 1rem 1.5rem 1.5rem;
}

.reward-card__referrals {
  font-size: 0.9rem;
  color: var(--color-body);
  margin-bottom: 0.5rem;
}

.reward-card__amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.1;
}

.reward-card__type {
  font-size: 0.95rem;
  color: var(--color-body);
  margin-top: 0.25rem;
}

.rewards__note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-body);
}

.rewards__note a {
  text-decoration: underline;
}

/* ============================================================
   4. TRUST / SOCIAL PROOF
   ============================================================ */
.trust {
  padding: 60px 0;
  background: var(--color-white);
}

.trust__items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.trust__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-light-bg);
  border-radius: var(--radius);
}

.trust__item svg {
  flex-shrink: 0;
}

.trust__item strong {
  display: block;
  font-size: 1.05rem;
  color: var(--color-heading);
}

.trust__item p {
  font-size: 0.9rem;
  color: var(--color-body);
  margin: 0;
}

/* ============================================================
   5. GIFT CARD CAROUSEL
   ============================================================ */
.carousel {
  padding: 60px 0;
  background: var(--color-light-bg);
  overflow: hidden;
}

.carousel__track-wrapper {
  position: relative;
  margin-top: 1rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.carousel__track {
  display: flex;
  gap: 2rem;
  animation: carousel-scroll 30s linear infinite;
  width: max-content;
}

.carousel__track:hover {
  animation-play-state: paused;
}

.carousel__item {
  flex-shrink: 0;
  width: 150px;
  height: 90px;
  background: var(--color-white);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border);
}

.carousel__item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.carousel__brand {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-heading);
  opacity: 0.7;
}

@keyframes carousel-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ============================================================
   6. REFERRAL FORM
   ============================================================ */
.form-section {
  padding: 80px 0;
  background: var(--color-white);
}

.referral-form {
  max-width: 560px;
  margin: 0 auto;
}

/* Progress dots */
.form-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
}

.form-progress__dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--color-border);
  color: var(--color-body);
  transition: all var(--transition);
}

.form-progress__dot--active {
  background: var(--color-primary);
  color: var(--color-white);
}

.form-progress__dot--completed {
  background: var(--color-success);
  color: var(--color-white);
}

.form-progress__line {
  width: 60px;
  height: 3px;
  background: var(--color-border);
  transition: background var(--transition);
}

.form-progress__line--active {
  background: var(--color-primary);
}

/* Fieldsets / steps */
.form-step {
  border: none;
  display: none;
}

.form-step--active {
  display: block;
}

.form-step__legend {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 1.5rem;
  width: 100%;
  text-align: center;
}

/* Form groups */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-heading);
  margin-bottom: 0.4rem;
}

.form-optional {
  font-weight: 400;
  color: var(--color-body);
  font-size: 0.85rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-family);
  font-size: 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-heading);
  transition: border-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(46, 163, 242, 0.15);
}

.form-group input.is-invalid,
.form-group select.is-invalid {
  border-color: var(--color-error);
}

.form-group input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

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

.form-error {
  display: block;
  font-size: 0.8rem;
  color: var(--color-error);
  margin-top: 0.3rem;
  min-height: 1.2em;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.form-actions .btn--full {
  flex: 1;
}

.form-actions .btn--outline {
  flex-shrink: 0;
}

.form-privacy {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-body);
  margin-top: 1rem;
}

/* Success state */
.form-success {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 0;
}

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

.form-success h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--color-success);
}

.form-success p {
  font-size: 1.05rem;
  color: var(--color-body);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ============================================================
   7. PROGRAM TERMS
   ============================================================ */
.terms {
  padding: 60px 0;
  background: var(--color-light-bg);
}

.terms__list {
  max-width: 720px;
  margin: 1.5rem auto 0;
}

.terms__list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  color: var(--color-body);
  line-height: 1.6;
}

.terms__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
}

/* ============================================================
   8. FOOTER
   ============================================================ */
.footer {
  background: var(--color-dark-bg);
  color: rgba(255, 255, 255, 0.7);
  padding-top: 60px;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer__brand img {
  margin-bottom: 0.75rem;
  max-height: 48px;
  width: auto;
  background: #fff;
  padding: 6px 10px;
  border-radius: 6px;
}

.footer__brand p {
  font-size: 0.95rem;
}

.footer h4 {
  color: var(--color-white);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.footer__contact p {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.footer__contact a {
  color: rgba(255, 255, 255, 0.7);
}

.footer__contact a:hover {
  color: var(--color-white);
}

.footer__social-links {
  display: flex;
  gap: 1rem;
}

.footer__social-links a {
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition);
}

.footer__social-links a:hover {
  color: var(--color-white);
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem 0;
}

.footer__bottom p {
  font-size: 0.85rem;
  text-align: center;
}

.footer__bottom a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
}

.footer__bottom a:hover {
  color: var(--color-white);
}

/* ============================================================
   TABLET — 768px+
   ============================================================ */
@media (min-width: 768px) {
  .section-title {
    font-size: 2rem;
  }

  .hero__headline {
    font-size: 2.75rem;
  }

  .hero__sub {
    font-size: 1.2rem;
  }

  .steps {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }

  .step__arrow {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .reward-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust__items {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__inner {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   DESKTOP — 1024px+
   ============================================================ */
@media (min-width: 1024px) {
  .container {
    padding: 0 40px;
  }

  .section-title {
    font-size: 2.25rem;
  }

  .hero {
    min-height: 85vh;
  }

  .hero__headline {
    font-size: 3rem;
  }

  .steps {
    gap: 1.5rem;
  }

  .step {
    max-width: 260px;
  }

  .reward-cards {
    grid-template-columns: repeat(4, 1fr);
  }

  .trust__items {
    grid-template-columns: repeat(4, 1fr);
  }
}
