/* components.css — repeated components and library overrides (Swiper, GLightbox).
   Colors, fonts and shadows come only from variables.css. */

/* ==========================================================================
   3.1 Headings
   ========================================================================== */

h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  font-size: clamp(34px, 5vw, 60px);
  overflow-wrap: break-word; /* long Finnish / Ukrainian words at 320px */
}

/* Card titles: sizes are set per component (step 24px, slider name 32px, plan 28px) */
h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.05;
  overflow-wrap: break-word;
}

.accent {
  color: var(--color-accent);
  text-shadow: 0 0 18px var(--glow);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--color-accent);
}

.eyebrow::before,
.eyebrow--center::after {
  content: "";
  flex: none;
  width: 40px;
  height: 1px;
  background: var(--color-accent);
}

/* ==========================================================================
   3.2 Buttons
   ========================================================================== */

.btn {
  --btn-slant: 10px;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 14px 32px;
  border: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(var(--btn-slant) 0, 100% 0, calc(100% - var(--btn-slant)) 100%, 0 100%);
  transition: color .45s var(--ease-out);
}

/* Large button: hero, form submit */
.btn--lg {
  padding: 18px 34px;
  font-size: 17px;
}

/* Full-width button: plan cards, form submit */
.btn--block {
  display: flex;
  width: 100%;
}

/* Fill sweeping left to right */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease-out);
}

.btn:hover::before,
.btn:focus-visible::before {
  transform: scaleX(1);
}

/* The clip-path would cut an outer outline, so the focus ring is drawn inside */
.btn:focus-visible {
  outline: var(--border-width-strong) solid var(--color-on-accent);
  outline-offset: -7px;
}

/* a:hover in base.css has higher specificity than .btn, so the colors are repeated for the states */
.btn--primary,
.btn--primary:hover,
.btn--primary:focus-visible {
  color: var(--color-on-accent);
}

.btn--primary {
  font-weight: 900;
  background: var(--color-accent);
  box-shadow: 0 0 22px var(--glow);
}

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

.btn--ghost {
  color: var(--color-text);
  background: var(--color-border-strong); /* shows as the 1px border: clip-path would cut a real one on the slanted sides */
}

.btn--ghost::after {
  content: "";
  position: absolute;
  inset: var(--border-width);
  z-index: -2;
  background: var(--color-surface-2);
  clip-path: polygon(var(--btn-slant) 0, 100% 0, calc(100% - var(--btn-slant)) 100%, 0 100%);
}

.btn--ghost::before {
  background: var(--color-accent);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  color: var(--color-on-accent);
}

/* Sending: the button is disabled, the fill does not sweep, a spinner replaces the glow */
.btn:disabled {
  cursor: progress;
  box-shadow: none;
}

.btn:disabled::before {
  transform: scaleX(0);
}

.btn--primary:disabled,
.btn--primary:disabled:hover {
  background: var(--color-border-accent);
  color: var(--color-text);
}

.btn__spinner {
  display: none;
  flex: none;
  width: 18px;
  height: 18px;
  border: var(--border-width-strong) solid currentColor;
  border-right-color: transparent;
  border-radius: var(--radius-round);
  animation: btn-spin .7s linear infinite;
}

.btn.is-loading .btn__spinner {
  display: inline-block;
}

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

/* ==========================================================================
   3.3 Cards
   Radius depends on the card: set --radius-md / --radius-lg in the section.
   ========================================================================== */

.card {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-card);
  transition:
    box-shadow .2s var(--ease-out),
    border-color .2s var(--ease-out);
}

.card:hover {
  border-color: var(--color-border-accent);
  box-shadow: var(--shadow-card-hover);
}

/* ==========================================================================
   3.4 Backgrounds and dividers
   ========================================================================== */

.section--base {
  background-color: var(--color-bg);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

/* Green "smoke": Hero, About, Contact */
.section--smoke {
  background-color: var(--color-bg);
  background-image:
    radial-gradient(60% 50% at 85% 20%, var(--smoke-1), transparent 70%),
    radial-gradient(50% 45% at 10% 90%, var(--smoke-2), transparent 70%);
}

/* Softer smoke from the top on the alternate background: Results, Plans */
.section--smoke-alt {
  background-color: var(--color-bg-alt);
  background-image: radial-gradient(55% 60% at 50% 0%, var(--smoke-3), transparent 70%);
}

.section + .section {
  border-top: var(--border-width) solid var(--color-divider);
}

/* ==========================================================================
   3.5 Form fields (styles only)
   ========================================================================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text-soft);
}

.field__req {
  margin-left: 2px;
  color: var(--color-accent);
}

.field__control {
  width: 100%;
  padding: 14px;
  background: var(--color-bg);
  border: var(--border-width) solid var(--color-border-input);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px; /* 16px stops iOS from zooming on focus */
  line-height: 1.4;
  color-scheme: dark;
  transition:
    border-color .2s var(--ease-out),
    box-shadow .2s var(--ease-out);
}

.field__control::placeholder {
  color: var(--color-text-dim);
  opacity: 1;
}

.field__control:hover {
  border-color: var(--color-border-accent);
}

.field__control:focus,
.field__control:focus-visible {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--glow-soft);
  outline: var(--border-width-strong) solid var(--color-accent);
  outline-offset: 1px;
}

textarea.field__control {
  min-height: 120px;
  resize: vertical;
}

/* Select: native arrow replaced with a chevron drawn by two gradients */
select.field__control {
  appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--color-accent) 50%),
    linear-gradient(135deg, var(--color-accent) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

select.field__control option {
  background: var(--color-surface-2);
  color: var(--color-text);
}

/* ==========================================================================
   Social icon: round link with an SVG glyph (header, contact, footer)
   ========================================================================== */

.social {
  --social-size: 36px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--social-size);
  height: var(--social-size);
  color: var(--color-accent);
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-round);
  box-shadow: 0 0 12px var(--glow-card);
  transition:
    color .2s var(--ease-out),
    background-color .2s var(--ease-out),
    border-color .2s var(--ease-out);
}

.social:hover,
.social:focus-visible {
  color: var(--color-on-accent);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.social__icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social__icon-dot {
  fill: currentColor;
  stroke: none;
}

@media (min-width: 640px) {
  .social {
    --social-size: 44px;
  }
}

/* ==========================================================================
   Section head: eyebrow + h2. The gap below depends on the section (see sections.css)
   ========================================================================== */

.section__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 40px;
}

.section__head--center {
  align-items: center;
  text-align: center;
}

/* ==========================================================================
   Check list: lime checkmarks (About achievements, plan features)
   ========================================================================== */

.check-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.check-list__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-soft);
}

.check-list__icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px var(--glow));
}

/* ==========================================================================
   Arrow: round 54px prev / next button (results slider)
   prev — outlined, next — lime fill with glow.
   ========================================================================== */

.arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 54px;
  height: 54px;
  color: var(--color-text);
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-round);
  transition:
    color .2s var(--ease-out),
    background-color .2s var(--ease-out),
    border-color .2s var(--ease-out);
}

.arrow:hover,
.arrow:focus-visible {
  color: var(--color-on-accent);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.arrow--next,
.arrow--next:hover,
.arrow--next:focus-visible {
  color: var(--color-on-accent);
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 20px var(--glow);
}

.arrow--next:hover,
.arrow--next:focus-visible {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.arrow__icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow--next .arrow__icon {
  stroke-width: 2.5;
}

/* ==========================================================================
   3.6 Library overrides
   prefers-reduced-motion for the libraries is covered by the global rule in
   base.css (it keeps transitionend / animationend firing, which GLightbox
   relies on); autoplay, speed and GLightbox effects are set in main.js.
   ========================================================================== */

/* --- Swiper -------------------------------------------------------------- */

:root {
  --swiper-theme-color: var(--color-accent);
  --swiper-pagination-bullet-horizontal-gap: 4px;
}

/* The slider arrows are our own round buttons (.arrow, see above), not Swiper's built-in
   .swiper-button-*; Swiper only wires them up via navigation: { prevEl, nextEl }. */

/* Dots: Swiper renders <button class="swiper-pagination-bullet"> (bulletElement: 'button').
   The button is the clickable area (28px tall); the visible 8px pill is its ::before. */
.swiper-pagination-bullet {
  position: relative;
  width: 8px;
  height: 28px;
  background: transparent;
  border-radius: 0;
  opacity: 1;
  transition: width .5s var(--ease-out);
}

.swiper-pagination-bullet::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 8px;
  margin-top: -4px;
  background: var(--color-dot);
  border-radius: var(--radius-dot);
  transition: background-color .3s var(--ease-out);
}

.swiper-pagination-bullet:hover::before {
  background: var(--color-dot-hover);
}

.swiper-pagination-bullet:focus-visible {
  outline: var(--border-width-strong) solid var(--color-accent);
  outline-offset: -2px;
}

/* Active: stretches to 42px, fully lime at once, glows and "bounces" */
.swiper-pagination-bullet-active {
  width: 42px;
  background: transparent;
}

.swiper-pagination-bullet-active::before,
.swiper-pagination-bullet-active:hover::before {
  background: var(--color-accent);
  box-shadow: 0 0 10px var(--glow);
  animation: dot-pop .5s var(--ease-out);
}

@keyframes dot-pop {
  0% { transform: scaleY(1); }
  35% { transform: scaleY(1.7); }
  100% { transform: scaleY(1); }
}

/* --- GLightbox ----------------------------------------------------------- */

.glightbox-container .goverlay,
.glightbox-mobile .goverlay {
  background: var(--color-overlay);
}

.glightbox-clean .gclose,
.glightbox-clean .gnext,
.glightbox-clean .gprev {
  background-color: var(--color-surface-2);
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-round);
  opacity: 1;
  transition:
    background-color .2s var(--ease-out),
    border-color .2s var(--ease-out);
}

.glightbox-clean .gclose path,
.glightbox-clean .gnext path,
.glightbox-clean .gprev path {
  fill: var(--color-accent);
  transition: fill .2s var(--ease-out);
}

.glightbox-clean .gclose:hover,
.glightbox-clean .gnext:hover,
.glightbox-clean .gprev:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  opacity: 1;
}

.glightbox-clean .gclose:hover path,
.glightbox-clean .gnext:hover path,
.glightbox-clean .gprev:hover path {
  fill: var(--color-on-accent);
}

.glightbox-clean .gclose:focus-visible,
.glightbox-clean .gnext:focus-visible,
.glightbox-clean .gprev:focus-visible,
.gbtn.focused {
  outline: var(--border-width-strong) solid var(--color-accent);
  outline-offset: 1px;
}

.glightbox-clean .gslide-media {
  border-radius: var(--radius-md);
  box-shadow:
    0 0 0 var(--border-width) var(--color-border-strong),
    0 0 40px var(--glow-soft);
}

.glightbox-clean .gslide-description {
  background: var(--color-surface);
  border-top: var(--border-width) solid var(--color-border);
}

.glightbox-clean .gslide-title,
.glightbox-mobile .glightbox-container .gslide-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-text);
}

.glightbox-clean .gslide-desc,
.glightbox-mobile .glightbox-container .gslide-desc {
  font-family: var(--font-body);
  color: var(--color-text-muted);
}

.glightbox-mobile .glightbox-container .gslide-description {
  background: linear-gradient(to bottom, transparent 0, var(--color-bg) 100%);
  border-top: 0;
}

.gloader {
  border-color: var(--color-accent);
  border-right-color: transparent;
}
