/* ============================================================
   OBA Solar — Components
   ------------------------------------------------------------
   Component styling: hero (full-screen bg + glass cards),
   guarantee carousel, buttons, contact form, footer, legal.
   Reads tokens.css. CC #9280.
   ============================================================ */

/* Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  font-weight: 700;
  font-size: var(--type-button);
  line-height: 1;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-xl);
  cursor: pointer;
  transition: background var(--duration-base) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--oba-yellow);
  color: var(--oba-blue);
  border-color: var(--oba-yellow-dark);
  box-shadow: var(--shadow-lg);
}
.btn-primary:hover { background: var(--oba-yellow-dark); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.98); }
.btn:focus-visible { outline: 3px solid var(--oba-blue); outline-offset: 2px; }

/* ════════════════════ HERO ════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero__bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.30) 0%, rgba(0,0,0,0.15) 45%, rgba(0,0,0,0.40) 100%);
}

/* Header (glass bar over hero) */
.hero__header { position: relative; z-index: 10; width: 100%; padding: var(--space-md) var(--container-pad) 0; }
.hero__header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: var(--space-md) var(--space-lg);
}
.hero__brand { display: flex; align-items: center; gap: var(--space-md); }
.hero__logo { width: auto; height: auto; max-width: 120px; }
.hero__brand-divider { align-self: stretch; border-left: 2px solid rgba(255,255,255,0.30); }
.hero__taglines { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.hero__tagline-1 { color: #fff; font-weight: 600; font-size: var(--type-body); text-shadow: 0 2px 8px rgba(0,0,0,0.45); }
.hero__tagline-2 { color: rgba(255,255,255,0.90); font-size: var(--type-body-s); text-shadow: 0 2px 6px rgba(0,0,0,0.4); }

@media (min-width: 768px) {
  .hero__logo { max-width: 180px; }
  .hero__tagline-1 { font-size: var(--type-body-l); }
  .hero__tagline-2 { font-size: var(--type-body); }
}
@media (min-width: 1024px) { .hero__logo { max-width: 200px; } }

/* Hero body (glass content card) */
.hero__body { position: relative; z-index: 10; flex: 1; display: flex; align-items: flex-start; padding: var(--space-md) var(--container-pad) var(--space-xl); }
@media (min-width: 768px) { .hero__body { align-items: center; padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); } }
.hero__body-inner { width: 100%; max-width: var(--container-max); margin: 0 auto; }
.hero__card {
  max-width: 760px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
@media (min-width: 768px) { .hero__card { padding: var(--space-xl); gap: var(--space-lg); } }

.hero__fear   { color: #fff; font-weight: 600; font-size: clamp(17px, 2.4vw, 30px); line-height: 1.4; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero__gtitle { color: #fff; font-weight: 700; font-size: clamp(17px, 2.4vw, 30px); line-height: 1.4; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero__shield { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -0.18em; margin-right: 0.35em; color: var(--oba-yellow); filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.hero__secondary { color: #fff; font-weight: 500; font-size: clamp(16px, 2.2vw, 28px); line-height: 1.4; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero__closing { color: #fff; font-weight: 700; font-size: clamp(19px, 2.8vw, 36px); line-height: 1.35; text-shadow: 0 3px 14px rgba(0,0,0,0.55); }

/* ═══════ GUARANTEE CAROUSEL ═══════ */
.guarantee { position: relative; }
.guarantee__box {
  background: rgba(var(--oba-yellow-rgb), 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 2px solid var(--oba-yellow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xs) var(--space-md) var(--space-2xs);
  position: relative;
  z-index: 2;
  user-select: none;
}
.guarantee__text {
  color: var(--oba-blue);
  font-size: clamp(15px, 2vw, 28px);
  line-height: 1.35;
  min-height: 54px;
  transition: opacity var(--duration-base) var(--ease-out);
}
@media (min-width: 768px) { .guarantee__text { min-height: 96px; } }
.guarantee__text.is-fading { opacity: 0; }
.guarantee__text strong { font-weight: 700; }
.guarantee__text span.detail { font-weight: 400; }

.guarantee__sep { font-weight: 400; }
/* Pagination dots — a clean progress ring circumscribes the active dot */
.guarantee__dots { display: flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-sm); padding-bottom: var(--space-3xs); }
.guarantee__dot {
  position: relative;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.guarantee__dot-fill {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(var(--oba-blue-rgb), 0.32);
  transition: background var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}
.guarantee__dot.is-active .guarantee__dot-fill { background: var(--oba-blue); transform: scale(1.15); }
.guarantee__dot:hover .guarantee__dot-fill { background: rgba(var(--oba-blue-rgb), 0.6); }
.guarantee__dot:focus-visible { outline: 2px solid var(--oba-blue); outline-offset: 2px; }
.guarantee__ring { position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; transform: rotate(-90deg); pointer-events: none; }
.guarantee__ring circle {
  stroke: var(--oba-blue);
  stroke-dasharray: 56.55;
  stroke-dashoffset: 56.55;
  animation: ring-progress var(--ring-ms, 4000ms) linear forwards;
}
@keyframes ring-progress { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .guarantee__ring circle { animation: none; }
}

/* Rotating image — tilted framed photo, sitting cleanly BELOW the box (no overlap) */
.guarantee__imagewrap { display: flex; justify-content: flex-end; margin-top: var(--space-md); margin-right: 2%; }
.guarantee__frame {
  position: relative;
  width: 72%;
  aspect-ratio: 1.56;
  border: 3px solid #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: rotate(2deg);
  transition: transform var(--duration-base) var(--ease-out);
  cursor: pointer;
  background: rgba(var(--oba-blue-rgb), 0.12);
}
.guarantee__frame:hover { transform: rotate(0deg); }
/* Two stacked layers crossfade: the incoming layer preloads hidden (blur + scale),
   then reveals once ready — no half-loaded flash, a deliberate blur crossfade. */
.guarantee__layer {
  position: absolute; inset: 0;
  opacity: 0;
  transform: scale(1.06);
  filter: blur(14px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out),
              filter var(--duration-slow) var(--ease-out);
  will-change: opacity, transform, filter;
}
.guarantee__layer.is-shown { opacity: 1; transform: scale(1); filter: blur(0); }
.guarantee__layer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 768px) {
  .guarantee__imagewrap { margin-top: var(--space-lg); margin-right: 4%; }
  .guarantee__frame { width: 440px; border-width: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .guarantee__layer { transition: opacity 1ms linear; transform: none; filter: none; }
}

.hero__cta { align-self: flex-start; margin-top: var(--space-2xs); font-size: clamp(16px, 2vw, 24px); padding: var(--space-md) var(--space-xl); border-radius: var(--radius-md); }

/* ════════════════════ CONTACT ════════════════════ */
.contact { background: var(--light-blue); }
.contact__inner { max-width: 680px; margin: 0 auto; }
.contact__heading { text-align: center; color: var(--oba-blue); margin-bottom: var(--space-2xs); }
.contact__sub { text-align: center; color: var(--charcoal); margin-bottom: var(--space-2xl); }

.form-row { display: grid; grid-template-columns: 1fr; gap: var(--space-md); }
@media (min-width: 768px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } }
.form-group { margin-bottom: var(--space-md); }
.form-label { display: block; font-size: var(--type-body-s); font-weight: 600; color: var(--oba-blue); margin-bottom: var(--space-2xs); }
.form-input, .form-textarea {
  width: 100%;
  padding: var(--space-xs) var(--space-sm);
  background: var(--warm-white);
  border: 1px solid var(--medium-blue);
  border-radius: var(--radius-sm);
  color: var(--soft-black);
  transition: border-color var(--duration-base) var(--ease-out);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--charcoal); opacity: 0.7; }
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--oba-blue); }
.form-textarea { resize: vertical; min-height: 120px; }

.form-file input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.form-file__label {
  display: flex; align-items: center;
  width: 100%; padding: var(--space-xs) var(--space-sm);
  background: var(--warm-white); border: 1px solid var(--medium-blue);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color var(--duration-base) var(--ease-out);
}
.form-file__label:hover { border-color: var(--oba-blue); }
.form-file__btn {
  display: inline-block; padding: var(--space-2xs) var(--space-md);
  background: var(--oba-yellow); color: var(--oba-blue);
  font-weight: 600; border-radius: var(--radius-sm);
  white-space: nowrap; flex-shrink: 0;
}
.form-file__btn:hover { background: var(--oba-yellow-dark); }
.form-file__name { margin-left: var(--space-md); color: var(--soft-black); font-size: var(--type-body-s); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-file__hint { font-size: var(--type-body-s); color: var(--charcoal); margin-top: var(--space-2xs); }

.form-privacy { display: flex; align-items: flex-start; gap: var(--space-xs); }
.form-privacy input { margin-top: 4px; width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--oba-yellow); }
.form-privacy label { font-size: var(--type-body-s); color: var(--soft-black); }
.form-privacy a { color: var(--oba-blue); text-decoration: underline; }
.form-privacy a:hover { color: var(--oba-yellow-dark); }

.form-error { padding: var(--space-sm); background: #fde8e8; border: 1px solid #f5b5b5; color: #9b1c1c; border-radius: var(--radius-sm); font-size: var(--type-body-s); }
.form-submit { width: 100%; }
.form-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.contact__alt { margin-top: var(--space-2xl); text-align: center; }
.contact__alt p { color: var(--soft-black); margin-bottom: var(--space-2xs); }
.contact__alt a { color: var(--oba-blue); font-weight: 600; }
.contact__alt a:hover { color: var(--oba-yellow-dark); }

.contact__success { max-width: 680px; margin: 0 auto; text-align: center; }
.contact__success h2 { color: var(--oba-blue); margin-bottom: var(--space-md); }
.contact__success p { color: var(--soft-black); font-size: var(--type-body-l); }

/* ════════════════════ FOOTER ════════════════════ */
.site-footer { background: var(--oba-blue); color: var(--off-white); padding: var(--space-2xl) var(--container-pad); }
.site-footer__inner { max-width: var(--container-max); margin: 0 auto; text-align: center; display: flex; flex-direction: column; gap: var(--space-md); }
.site-footer a { color: var(--off-white); }
.site-footer__email a:hover { color: var(--oba-yellow); }
.site-footer__legal { display: flex; justify-content: center; gap: var(--space-md); }
.site-footer__legal a { color: var(--oba-yellow); }
.site-footer__legal a:hover { text-decoration: underline; }
.site-footer__sep { color: rgba(255,255,255,0.4); }
.site-footer__copyright { font-size: var(--type-body-s); color: rgba(255,255,255,0.6); padding-top: var(--space-md); }

/* ════════════════════ LEGAL PAGES ════════════════════ */
.legal { background: var(--off-white); padding: var(--space-3xl) var(--container-pad); min-height: 100vh; }
.legal__inner { max-width: 880px; margin: 0 auto; }
.legal p, .legal a, .legal li, .legal h1, .legal h2, .legal h3 { overflow-wrap: anywhere; word-break: break-word; }
.legal h1 { color: var(--oba-blue); margin-bottom: var(--space-lg); }
.legal section { margin-bottom: var(--space-lg); }
.legal h2 { color: var(--oba-blue); font-size: var(--type-h3); margin-bottom: var(--space-sm); }
.legal h3 { color: var(--oba-blue); font-size: var(--type-h4); margin-top: var(--space-md); margin-bottom: var(--space-2xs); }
.legal p { color: var(--soft-black); margin-bottom: var(--space-sm); }
.legal ul { list-style: disc; padding-left: var(--space-lg); margin-bottom: var(--space-sm); }
.legal ul li { color: var(--soft-black); margin-bottom: var(--space-3xs); }
.legal a { color: var(--oba-blue); text-decoration: underline; }
.legal a:hover { color: var(--oba-yellow-dark); }
.legal__back { margin-top: var(--space-2xl); padding-top: var(--space-lg); border-top: 1px solid var(--medium-blue); }
.legal__back a { color: var(--oba-blue); font-weight: 600; text-decoration: none; }
.legal__back a:hover { color: var(--oba-yellow-dark); }
.legal__source { font-size: var(--type-body-s); color: var(--charcoal); margin-bottom: var(--space-md); }

/* ════════════════════ 404 ════════════════════ */
.notfound { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--container-pad); background: var(--off-white); }
.notfound__code { font-size: 88px; font-weight: 700; color: var(--oba-yellow); line-height: 1; }
.notfound h1 { color: var(--oba-blue); margin: var(--space-md) 0; }
.notfound p { color: var(--charcoal); margin-bottom: var(--space-lg); }
