/* =============================================================================
   Calculator page + component styles. Built on top of tokens.css.
   Mobile-first: calculator first, sticky summary, large CTA. No framework.
   ============================================================================= */

/* --- Layout primitives ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section-heading {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

/* --- Site header ---------------------------------------------------------- */
.site-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--text-dark);
  font-weight: 800;
  text-decoration: none;
}

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

.brand-logo {
  height: 40px;
  width: 40px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.site-header-tagline {
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
}

/* --- Hero ----------------------------------------------------------------- */
.hero {
  background:
    radial-gradient(900px 320px at 90% -10%, rgba(255, 212, 55, .18), transparent 60%),
    var(--bg-dark);
  color: var(--bg-white);
  padding: 3rem 0 2.5rem;
}

.hero-inner {
  max-width: 760px;
}

.hero-eyebrow {
  margin: 0 0 .75rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  color: var(--bg-white);
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  margin: 0 0 1rem;
}

.hero-price {
  color: var(--accent);
  white-space: nowrap;
}

.hero-lead {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  color: var(--primary-light);
  max-width: 56ch;
}

.hero-note {
  display: inline-block;
  margin: 0;
  padding: .4rem .9rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .08);
  color: var(--bg-white);
  font-size: .9rem;
  font-weight: 600;
}

/* --- Order grid ----------------------------------------------------------- */
.order-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.order-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-width: 0;
}

.card + .card {
  margin-top: 1rem;
}

/* --- Package card --------------------------------------------------------- */
.package-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.package-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
}

.package-desc {
  margin: .25rem 0 0;
  color: var(--text-muted);
  font-size: .92rem;
}

.package-price {
  margin: 0;
  flex-shrink: 0;
  text-align: right;
}

.package-price-value {
  display: inline-block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--bg-light);
  border-radius: var(--radius-md);
  padding: .35rem .8rem;
  white-space: nowrap;
}

/* --- Included list -------------------------------------------------------- */
.included {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.included-title {
  margin: 0 0 .75rem;
  font-weight: 700;
  color: var(--text-dark);
}

.included-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .55rem;
}

.included-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--text-body);
}

.included-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--ok-bg);
  color: var(--ok);
}

.included-note {
  margin: 1rem 0 0;
  font-size: .85rem;
  color: var(--text-muted);
}

/* --- Addons --------------------------------------------------------------- */
.addons-title {
  margin: 0 0 .25rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
}

.addons-hint {
  margin: 0 0 1rem;
  font-size: .9rem;
  color: var(--text-muted);
}

.addon-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}

/* Additional-pages panel (revealed when the "Lisaleht" addon is selected). */
.addon-pages {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px dashed var(--primary-light);
  border-radius: var(--radius-md);
  background: var(--bg-light);
}

.addon-pages-title {
  margin: 0 0 .75rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
}

.addon-pages-note {
  font-weight: 600;
  font-size: .85rem;
  color: var(--accent-dark);
  background: var(--bg-white);
  border-radius: var(--radius-pill);
  padding: .15rem .6rem;
}

.page-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: .75rem;
}

.page-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.page-row .page-input {
  flex: 1 1 auto;
}

.page-remove {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background-color .12s ease;
}

.page-remove:hover {
  color: var(--err);
  border-color: var(--err);
  background: var(--err-bg);
}

.page-add {
  border: 1px solid var(--primary);
  background: var(--bg-white);
  color: var(--primary);
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: .5rem 1rem;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}

.page-add:hover {
  background: var(--primary);
  color: var(--bg-white);
}

.addon-option {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease, box-shadow .12s ease;
}

.addon-option:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.addon-option.is-checked {
  border-color: var(--primary);
  background: var(--bg-light);
}

.addon-checkbox {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.addon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-white);
  color: transparent;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.addon-option.is-checked .addon-box {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--bg-white);
}

.addon-checkbox:focus-visible + .addon-box {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.addon-text {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  flex: 1;
  min-width: 0;
}

.addon-label {
  font-weight: 600;
  color: var(--text-dark);
}

.addon-price {
  flex-shrink: 0;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* --- Domain --------------------------------------------------------------- */
.domain-title {
  margin: 0 0 .25rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
}

.domain-hint {
  margin: 0 0 1rem;
  font-size: .9rem;
  color: var(--text-muted);
}

.domain-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.domain-input {
  flex: 1 1 220px;
  min-width: 0;
}

.domain-check-btn {
  flex-shrink: 0;
}

.domain-check-btn[aria-busy='true'] {
  opacity: .7;
  cursor: progress;
}

.domain-status {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .85rem;
  padding: .7rem .9rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: .95rem;
}

.domain-status.is-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.domain-status.is-err {
  background: var(--err-bg);
  color: var(--err);
}

.domain-status.is-info {
  background: var(--bg-light);
  color: var(--text-body);
}

.domain-disclaimer {
  margin: 1rem 0 0;
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Customer form -------------------------------------------------------- */
.form-group-title {
  margin: 0 0 .85rem;
  font-size: .95rem;
  font-weight: 800;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.customer-card .form-group-title:not(:first-child) {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.form-group-optional {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}

.field-full {
  margin-top: 1rem;
}

.field-label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-dark);
}

.field-required {
  color: var(--err);
}

.field-input {
  width: 100%;
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: .7rem .9rem;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.field-input::placeholder {
  color: var(--text-muted);
}

.field-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(12, 20, 75, .12);
}

.field-textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
}

.field.has-error .field-input {
  border-color: var(--err);
}

.field-error {
  margin: 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--err);
}

/* --- Summary -------------------------------------------------------------- */
.summary {
  min-width: 0;
}

.summary-heading {
  font-size: 1.1rem;
  margin-bottom: 1.1rem;
}

.summary-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .65rem;
}

.summary-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-body);
}

.summary-line-value {
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
}

.summary-line-total {
  margin-top: .5rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border-color);
}

.summary-line-total .summary-line-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
}

.summary-line-total .summary-line-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}

.summary-billing {
  margin: 1rem 0 1.25rem;
  font-size: .82rem;
  color: var(--text-muted);
}

.summary-cta {
  width: 100%;
  font-size: 1.05rem;
}

.summary-cta-hint {
  margin: .75rem 0 0;
  font-size: .82rem;
  color: var(--text-muted);
  text-align: center;
}

.summary-cta-hint.is-ready {
  color: var(--ok);
  font-weight: 600;
}

/* --- Site footer ---------------------------------------------------------- */
.site-footer {
  margin-top: 1rem;
  background: var(--bg-dark);
  color: var(--primary-light);
}

.site-footer-inner {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.site-footer-copy {
  margin: 0 0 .35rem;
  color: var(--bg-white);
  font-weight: 600;
}

.site-footer-note {
  margin: 0;
  font-size: .85rem;
}

/* --- Desktop: two-column with sticky summary ------------------------------ */
@media (min-width: 880px) {
  .order-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
  }

  .addon-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .summary {
    position: sticky;
    top: 1.5rem;
  }
}

/* --- Mobile: summary becomes a sticky bottom bar -------------------------- */
@media (max-width: 879px) {
  .order-grid {
    padding-bottom: 7.5rem; /* room for the fixed bottom bar */
  }

  .summary {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 0;
  }

  .summary-card {
    margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
    box-shadow: var(--shadow-xl);
    padding: 1rem 1.25rem 1.1rem;
  }

  .summary-heading,
  .summary-line:not(.summary-line-total),
  .summary-billing {
    display: none;
  }

  .summary-line-total {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-bottom: .65rem;
  }

  .summary-cta-hint {
    display: none;
  }
}
