/* components.css — Reusable UI: brand, buttons, panels, plans, tables, FAQ, forms, help, dialog */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--navy);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -.04em;
}

.brand img {
  width: 36px;
  height: 36px;
}

.account-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  background: var(--blue);
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 19px;
  line-height: 1.4;
  min-height: 44px;
}

.btn:hover {
  background: #183c66;
  color: #fff;
  text-decoration: none;
}

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

.btn.secondary:hover {
  background: var(--light);
}

.text-button {
  border: 0;
  background: transparent;
  padding: 7px 0;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 44px;
}

.nav-links {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 14px 16px;
  text-decoration: none;
  font-weight: 600;
  color: var(--navy);
  border-bottom: 3px solid transparent;
}

.nav-links a:first-child {
  padding-left: 0;
}

.nav-links a[aria-current=page] {
  border-color: var(--blue);
}

.nav-links a:hover {
  background: var(--light);
}

.currency-control {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: .875rem;
  flex-shrink: 0;
}

.currency-control select {
  padding: 7px 30px 7px 9px;
  min-height: 38px;
  border: 1px solid #b9c7d2;
  background: white;
  border-radius: 3px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='9'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%23243544' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.plan-toolbar {
  display: flex;
  margin-bottom: 18px;
}

@media (min-width: 650px) {
  .plan-toolbar {
    justify-content: flex-end;
  }
}

.mobile-menu {
  display: none;
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
  border-radius: 3px;
  padding: 8px 15px;
  min-height: 44px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 26px 0 12px;
}

.account-panel {
  background: white;
  border: 1px solid var(--line);
  padding: 27px;
  border-radius: 4px;
}

.account-panel h2 {
  font-size: 1.35rem;
}

.account-panel .btn {
  width: 100%;
  margin-bottom: 12px;
}

.account-panel p {
  font-size: .94rem;
  color: var(--muted);
}

.service-box {
  border-top: 3px solid var(--line);
  padding-top: 19px;
}

.service-box p {
  color: var(--muted);
}

.service-box a {
  font-weight: 600;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .875rem;
  color: var(--muted);
  padding: 18px 0;
}

.breadcrumb a {
  color: var(--muted);
}

.notice {
  background: var(--light);
  border-left: 3px solid var(--blue);
  padding: 18px 22px;
  margin: 24px 0;
}

.notice p:last-child {
  margin-bottom: 0;
}

.plan {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  padding: 25px 21px;
  display: flex;
  flex-direction: column;
}

.plan h3 {
  margin-bottom: 9px;
}

.plan .strap {
  font-size: .94rem;
  color: var(--muted);
  min-height: 48px;
}

.price {
  font-size: 1.8rem;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.price-unit {
  font-size: .8rem;
  color: var(--muted);
  font-weight: 400;
  display: block;
  margin-top: 4px;
}

.plan ul {
  padding: 0;
  list-style: none;
  margin-bottom: 24px;
  font-size: .94rem;
}

.plan li {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.plan .btn {
  margin-top: auto;
  width: 100%;
  font-size: .94rem;
}

.table-scroll {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  margin: 22px 0;
}

.comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: .94rem;
  text-align: left;
  min-width: 750px;
}

.comparison caption {
  padding: 16px;
  text-align: left;
  font-weight: 700;
  color: var(--navy);
}

.comparison th,
.comparison td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.comparison thead th {
  background: var(--navy);
  color: white;
}

.comparison thead th:first-child {
  width: 28%;
}

.comparison tbody th {
  font-weight: 400;
  color: var(--ink);
}

.comparison .group th {
  background: #e9eef4;
  color: var(--navy);
  font-weight: 700;
}

.comparison tr:last-child td,
.comparison tr:last-child th {
  border-bottom: 0;
}

.compare-tools {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  padding: 16px 0;
}

.compare-tools a {
  font-size: .94rem;
}

.faq {
  border-top: 1px solid var(--line);
  margin-top: 35px;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.faq summary {
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  padding: 3px 0;
}

.faq details p {
  margin: 13px 0 0;
}

.search-form {
  display: flex;
  gap: 10px;
  max-width: 760px;
  margin: 25px 0 15px;
}

.search-form input {
  flex: 1;
  min-width: 0;
}

.input,
select.input {
  border: 1px solid #afbdc9;
  background: white;
  border-radius: 3px;
  padding: 11px 12px;
  width: 100%;
  color: var(--ink);
}

.input[aria-invalid=true] {
  border: 2px solid var(--danger);
}

.help-categories {
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-categories button {
  border: 0;
  border-left: 3px solid transparent;
  background: white;
  display: block;
  text-align: left;
  width: 100%;
  padding: 12px 15px;
  color: var(--navy);
}

.help-categories button.active {
  border-color: var(--blue);
  background: var(--light);
  font-weight: 700;
}

.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-list li {
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.article-list li:first-child {
  padding-top: 0;
}

.article-list h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.article-list a {
  font-weight: 600;
  text-decoration: none;
}

.article-list a:hover {
  text-decoration: underline;
}

.article-list p {
  font-size: .94rem;
  color: var(--muted);
  margin: 0;
}

.article-list .category {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.related {
  margin-top: 35px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.related ul {
  padding-left: 20px;
}

.form-alert {
  background: #fbeeee;
  border-left: 3px solid var(--danger);
  color: var(--danger);
  font-weight: 600;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.field {
  margin: 0 0 22px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 7px;
}

.field .hint {
  font-size: .875rem;
  color: var(--muted);
  margin-top: 5px;
}

.error {
  display: block;
  font-size: .875rem;
  color: var(--danger);
  margin-top: 5px;
}

.error:empty {
  display: none;
}

.validation-summary {
  color: var(--danger);
  font-weight: 600;
  margin-bottom: 20px;
}

.form-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}

.dialog {
  border: 0;
  border-radius: 5px;
  padding: 30px;
  max-width: 560px;
  width: calc(100% - 40px);
  color: var(--ink);
  box-shadow: 0 12px 60px #0003;
}

.dialog::backdrop {
  background: #14263688;
}

.dialog h2 {
  font-size: 1.5rem;
  padding-right: 20px;
}

.dialog p {
  white-space: pre-line;
}

.dialog .btn {
  margin-top: 10px;
}

.dialog form {
  margin: 0;
}

.no-results {
  padding: 25px;
  background: var(--light);
}

.legal-list li {
  margin-bottom: 10px;
}


/* Cookie banner (mobile first) */
.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover {
  text-decoration-thickness: 2px;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  max-height: 85vh;
  overflow: auto;
  background: var(--paper);
  border-top: 3px solid var(--blue);
  box-shadow: 0 -6px 30px #0002;
  padding: 20px 0;
}

.cookie-banner-inner {
  display: grid;
  gap: 16px;
}

.cookie-banner h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.cookie-banner h2:focus {
  outline: none;
}

.cookie-banner p {
  margin: 0;
  font-size: .94rem;
  color: var(--muted);
  max-width: 78ch;
}

.cookie-preferences fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.cookie-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: .94rem;
}

.cookie-option input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.cookie-option strong {
  display: block;
  color: var(--navy);
}

.cookie-actions {
  display: grid;
  gap: 10px;
}

.cookie-actions [hidden] {
  display: none;
}

body.has-cookie-banner {
  padding-bottom: 260px;
}

@media (min-width: 650px) {
  .cookie-actions {
    display: flex;
    flex-wrap: wrap;
  }

  body.has-cookie-banner {
    padding-bottom: 170px;
  }
}

@media (max-width:900px) {
  .nav-links a {
    padding: 12px 9px;
  }
}

@media (max-width:650px) {
  .brand {
    font-size: 1.45rem;
  }

  .brand img {
    width: 31px;
    height: 31px;
  }

  .account-actions .signup-top {
    display: none;
  }

  .account-actions .btn {
    padding: 8px 12px;
    font-size: .875rem;
  }

  .mobile-menu {
    display: inline-block;
  }

  .nav-links {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    gap: 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a,
  .nav-links a:first-child {
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
  }

  .currency-control select {
    min-height: 44px;
  }

  .account-panel {
    padding: 22px;
  }

  .plan {
    padding: 20px 15px;
  }

  .plan .strap {
    min-height: 72px;
  }

  .price {
    font-size: 1.55rem;
  }

  .plan .btn {
    padding: 10px 8px;
  }

  .help-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .help-categories button {
    border: 1px solid var(--line);
    border-radius: 3px;
    width: auto;
    padding: 9px 11px;
  }

  .search-form {
    flex-wrap: wrap;
  }

  .search-form input {
    flex-basis: 65%;
  }

  .dialog {
    padding: 25px;
  }

  .comparison th,
  .comparison td {
    padding: 11px;
  }

}

@media print {
  .table-scroll {
    overflow: visible;
  }

  .comparison {
    min-width: 0;
    font-size: 10pt;
  }

  .comparison thead th {
    color: black;
    background: #eee;
  }
}

/* Custom arrow for select fields; must follow .input */
select.input {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='9'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%23243544' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
