/* ==========================================================================
   FREEDOM KITCHENS & BATHS — Reusable Components
   css/components.css
   ========================================================================== */


/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    background-color var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* --- Primary: Gold background, charcoal text --- */
.btn-primary {
  background-color: var(--color-accent);
  color: var(--charcoal);
  border-color: var(--color-accent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--charcoal);
  box-shadow: 0 6px 20px rgba(212, 169, 77, 0.35);
}

/* --- Secondary: Transparent / Navy border --- */
.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

/* --- White: White bg, Navy text (for dark backgrounds) --- */
.btn-white {
  background-color: var(--white);
  color: var(--color-primary);
  border-color: var(--white);
}

.btn-white:hover,
.btn-white:focus-visible {
  background-color: var(--color-bg-alt);
  border-color: var(--color-bg-alt);
  color: var(--color-primary);
}

/* --- Ghost White: Transparent / White border (for dark backgrounds) --- */
.btn-ghost-white {
  background-color: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-ghost-white:hover,
.btn-ghost-white:focus-visible {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--white);
  color: var(--white);
}

/* --- Size Modifiers --- */
.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: var(--font-size-body);
  border-radius: var(--radius-lg);
}

/* --- Icon Button --- */
.btn-icon {
  padding: 0.75rem;
  border-radius: var(--radius-full);
  aspect-ratio: 1;
}


/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
  background-color: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition:
    box-shadow var(--transition),
    transform var(--transition);
}

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

/* --- Card Image --- */
.card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--color-bg-alt);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-image img {
  transform: scale(1.05);
}

/* --- Card Image variants --- */
.card-image-wide {
  aspect-ratio: 16 / 9;
}

.card-image-square {
  aspect-ratio: 1 / 1;
}

/* --- Card Content --- */
.card-content {
  padding: var(--space-md);
}

.card-content h3,
.card-content h4 {
  margin-bottom: var(--space-xs);
}

.card-content p {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  line-height: var(--line-height-relaxed);
}

/* --- Card Footer --- */
.card-footer {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

/* --- Project / Portfolio Card --- */
.project-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
}

.project-card-image {
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover .project-card-image img {
  transform: scale(1.08);
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(27, 58, 92, 0.85) 0%,
    rgba(27, 58, 92, 0.3) 50%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-md);
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card:hover .project-card-overlay {
  opacity: 1;
}

.project-card-overlay h3 {
  color: var(--white);
  font-size: var(--font-size-h3);
  margin-bottom: var(--space-xs);
}

.project-card-overlay p {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--font-size-small);
  max-width: none;
}


/* ==========================================================================
   FORMS
   ========================================================================== */

.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.form-label.required::after {
  content: ' *';
  color: var(--color-error);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--color-text);
  background-color: var(--white);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27, 58, 92, 0.12);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--color-text-muted);
}

/* --- Select wrapper (for custom arrow) --- */
.form-select-wrapper {
  position: relative;
}

.form-select-wrapper::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--color-text-muted);
  pointer-events: none;
}

.form-select {
  padding-right: 2.5rem;
  cursor: pointer;
}

/* --- Textarea --- */
.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: var(--line-height-relaxed);
}

/* --- Validation states --- */
.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.form-input.is-success,
.form-select.is-success,
.form-textarea.is-success {
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.12);
}

/* --- Helper text --- */
.form-error {
  color: var(--color-error);
  font-size: var(--font-size-small);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-hint {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  margin-top: 0.25rem;
}

/* --- Form success state --- */
.form-success {
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.form-success h3 {
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.form-success p {
  color: var(--color-text-muted);
  max-width: none;
  margin-inline: auto;
}

/* --- Honeypot field (spam prevention — NOT display:none) --- */
.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  tab-index: -1;
}

/* --- Two-column form row --- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   STATS / NUMBERS
   ========================================================================== */

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  color: var(--color-accent);
  letter-spacing: var(--letter-spacing-tight);
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--font-size-body);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

/* Stats on dark backgrounds */
.stat--on-dark .stat-number {
  color: var(--color-accent);
}

.stat--on-dark .stat-label {
  color: rgba(255, 255, 255, 0.75);
}


/* ==========================================================================
   SECTION HEADERS
   ========================================================================== */

.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-header--left {
  text-align: left;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-widest);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

.section-title {
  font-size: var(--font-size-h2);
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

/* Decorative underline accent */
.section-title--accent {
  position: relative;
  padding-bottom: var(--space-sm);
}

.section-title--accent::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--color-accent);
  border-radius: var(--radius-full);
}

.section-header--left .section-title--accent::after {
  left: 0;
  transform: none;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin-inline: auto;
  line-height: var(--line-height-relaxed);
}

.section-header--left .section-subtitle {
  margin-inline: 0;
}


/* ==========================================================================
   BADGES
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-heading);
  line-height: 1;
  white-space: nowrap;
}

.badge-primary {
  background-color: rgba(27, 58, 92, 0.1);
  color: var(--color-primary);
}

.badge-accent {
  background-color: rgba(212, 169, 77, 0.15);
  color: var(--gold-dark);
}

.badge-success {
  background-color: rgba(25, 135, 84, 0.1);
  color: var(--color-success);
}

.badge-light {
  background-color: var(--color-bg-alt);
  color: var(--color-text-muted);
}

.badge-white {
  background-color: var(--white);
  color: var(--color-primary);
}


/* ==========================================================================
   VIDEO MODAL
   ========================================================================== */

.video-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.video-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.video-modal {
  position: relative;
  width: 90vw;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform var(--transition);
}

.video-modal-overlay.active .video-modal {
  transform: scale(1);
}

.video-modal iframe,
.video-modal video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.video-modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  transition: opacity var(--transition), transform var(--transition-fast);
  opacity: 0.85;
}

.video-modal-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

/* --- Video placeholder (before embed is ready) --- */
.video-modal-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--white);
  text-align: center;
  padding: var(--space-lg);
  gap: var(--space-sm);
  background: linear-gradient(135deg, var(--navy), var(--slate-blue));
}

.video-modal-placeholder .placeholder-icon {
  font-size: 4rem;
  opacity: 0.6;
}

.video-modal-placeholder p {
  color: rgba(255, 255, 255, 0.75);
  max-width: 40ch;
  margin-inline: auto;
}

/* --- Play button trigger --- */
.video-play-trigger {
  position: relative;
  cursor: pointer;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.video-play-trigger::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(27, 58, 92, 0.3);
  transition: background var(--transition);
}

.video-play-trigger:hover::after {
  background: rgba(27, 58, 92, 0.1);
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: 72px;
  height: 72px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), background-color var(--transition);
  box-shadow: 0 8px 32px rgba(212, 169, 77, 0.5);
}

.video-play-trigger:hover .play-button {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--color-accent-hover);
}

.play-button svg {
  width: 28px;
  height: 28px;
  fill: var(--charcoal);
  margin-left: 4px; /* Optical center for play triangle */
}


/* ==========================================================================
   TESTIMONIALS
   ========================================================================== */

.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  box-shadow: var(--shadow-md);
  position: relative;
}

.testimonial-quote {
  font-size: 1.125rem;
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
  margin-bottom: var(--space-md);
  font-style: italic;
}

.testimonial-quote::before {
  content: '\201C';
  font-family: var(--font-heading);
  font-size: 4rem;
  color: var(--color-accent);
  line-height: 0.8;
  display: block;
  margin-bottom: var(--space-xs);
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.testimonial-author-image {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.testimonial-author-name {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-small);
  color: var(--color-text);
  display: block;
}

.testimonial-author-location {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Stars */
.testimonial-stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-sm);
  color: var(--color-accent);
}


/* ==========================================================================
   PROCESS STEPS
   ========================================================================== */

.process-step {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.process-step-number {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(27, 58, 92, 0.08);
  border: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-h4);
  color: var(--color-primary);
}

.process-step-content h3 {
  margin-bottom: var(--space-xs);
}

.process-step-content p {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  line-height: var(--line-height-relaxed);
  max-width: none;
}


/* ==========================================================================
   CTA BAND (Full-width call-to-action strip)
   ========================================================================== */

.cta-band {
  background: linear-gradient(135deg, var(--navy) 0%, var(--slate-blue) 100%);
  padding: var(--space-xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(212, 169, 77, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(212, 169, 77, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.cta-band h2 {
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.cta-band p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.125rem;
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: var(--space-md);
  line-height: var(--line-height-relaxed);
}

.cta-band-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}


/* ==========================================================================
   DIVIDERS & DECORATIVE ELEMENTS
   ========================================================================== */

.divider {
  width: 60px;
  height: 3px;
  background-color: var(--color-accent);
  border-radius: var(--radius-full);
  margin-block: var(--space-sm);
}

.divider--center {
  margin-inline: auto;
}

.divider--lg {
  width: 100px;
  height: 4px;
}


/* ==========================================================================
   NOTIFICATION / ALERT
   ========================================================================== */

.alert {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border-left: 4px solid;
  font-size: var(--font-size-small);
  line-height: var(--line-height-relaxed);
}

.alert p {
  max-width: none;
  color: inherit;
}

.alert-info {
  background-color: rgba(27, 58, 92, 0.08);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.alert-success {
  background-color: rgba(25, 135, 84, 0.08);
  border-color: var(--color-success);
  color: var(--color-success);
}

.alert-warning {
  background-color: rgba(212, 169, 77, 0.12);
  border-color: var(--color-accent);
  color: var(--gold-dark);
}

.alert-error {
  background-color: rgba(220, 53, 69, 0.08);
  border-color: var(--color-error);
  color: var(--color-error);
}


/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.btn.loading {
  pointer-events: none;
  opacity: 0.75;
  position: relative;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  margin-left: var(--space-xs);
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}


/* ==========================================================================
   MOBILE OVERRIDES (max-width: 480px)
   ========================================================================== */

@media (max-width: 480px) {
  /* CTA band — stack buttons vertically */
  .cta-band-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-band-actions .btn {
    width: 100%;
    text-align: center;
  }

  .cta-band h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .cta-band p {
    font-size: 1rem;
  }

  /* Section subtitles — slightly smaller on mobile */
  .section-subtitle {
    font-size: 1rem;
  }

  /* Section title — clamp for mobile */
  .section-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
}
