/* shared/contact-form.css — reusable Altiora contact form v90 */

.altiora-contact-form-host {
  width: 100%;
}

.altiora-contact-form {
  display: grid;
  gap: 18px;
}

.altiora-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.altiora-contact-form .altiora-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.altiora-contact-form .altiora-field-full {
  grid-column: 1 / -1;
}

.altiora-contact-form label {
  color: var(--muted, rgba(240,244,255,.70));
  font-size: 12px;
  line-height: 1.2;
}

.altiora-contact-form label span,
.altiora-contact-form label b {
  color: var(--danger, #ff677d);
  margin-left: 3px;
  font-weight: 700;
}

.altiora-contact-form input,
.altiora-contact-form select,
.altiora-contact-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  border-radius: 10px;
  background: rgba(3, 10, 22, .48);
  color: var(--text, #fff);
  min-height: 40px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.altiora-contact-form textarea {
  min-height: 96px;
  padding-top: 11px;
  resize: vertical;
}

.altiora-contact-form input:focus,
.altiora-contact-form select:focus,
.altiora-contact-form textarea:focus {
  border-color: rgba(102,178,255,.56);
  box-shadow: 0 0 0 3px rgba(47,128,255,.12);
}

.altiora-contact-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.altiora-contact-check {
  display: flex !important;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  padding: 10px 11px;
  cursor: pointer;
  color: var(--text, #fff) !important;
}

.altiora-contact-check input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin: 0;
  accent-color: #2f80ff;
}

.altiora-contact-check span {
  color: inherit !important;
  margin: 0 !important;
  overflow-wrap: anywhere;
}

.altiora-form-hint,
.altiora-contact-counter,
.altiora-contact-form small {
  color: var(--muted-2, rgba(240,244,255,.44));
  font-size: 11px;
  line-height: 1.35;
  margin: 0;
}

.altiora-field.is-invalid input,
.altiora-field.is-invalid select,
.altiora-field.is-invalid textarea,
.altiora-field.is-invalid .altiora-contact-check {
  border-color: rgba(255, 103, 125, .62);
}

.altiora-field.is-invalid small {
  color: #ff9aab;
}

.altiora-legal-checks {
  gap: 8px !important;
}

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

.altiora-contact-status {
  margin: 0;
  min-height: 18px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted, rgba(240,244,255,.70));
}

.altiora-contact-status.success {
  color: #bff4e2;
}

.altiora-contact-status.error {
  color: #ff9aab;
}

.altiora-catalog-btn:disabled {
  opacity: .62;
  cursor: progress;
}

.altiora-legal-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
}

.altiora-legal-modal.open {
  display: block;
}

.altiora-legal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.altiora-legal-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100vw - 28px));
  max-height: min(620px, calc(100dvh - 36px));
  transform: translate(-50%, -50%);
  border: 1px solid var(--line-2, rgba(112,149,210,.24));
  border-radius: 20px;
  background: #050f20;
  color: var(--text, #fff);
  box-shadow: 0 28px 80px rgba(0,0,0,.46);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.altiora-legal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line, rgba(255,255,255,.08));
}

.altiora-legal-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.altiora-legal-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  background: rgba(255,255,255,.06);
  color: var(--text, #fff);
  cursor: pointer;
  font-size: 20px;
}

.altiora-legal-body {
  padding: 16px 18px;
  overflow-y: auto;
  color: var(--muted, rgba(240,244,255,.72));
  font-size: 14px;
  line-height: 1.62;
}

.altiora-legal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line, rgba(255,255,255,.08));
}

.altiora-legal-primary,
.altiora-legal-secondary {
  min-height: 38px;
  border-radius: 10px;
  padding: 0 14px;
  font: inherit;
  cursor: pointer;
}

.altiora-legal-primary {
  border: 1px solid rgba(76,128,255,.56);
  background: rgba(47,128,255,.16);
  color: #9fc2ff;
}

.altiora-legal-secondary {
  border: 1px solid var(--line, rgba(255,255,255,.10));
  background: rgba(255,255,255,.045);
  color: var(--muted, rgba(240,244,255,.72));
}

html[data-theme="light"] .altiora-contact-form input,
html[data-theme="light"] .altiora-contact-form select,
html[data-theme="light"] .altiora-contact-form textarea,
html[data-theme="light"] .altiora-contact-check {
  background: rgba(255,255,255,.78);
  border-color: rgba(25,48,82,.12);
  color: #0c1728;
}

html[data-theme="light"] .altiora-contact-form label,
html[data-theme="light"] .altiora-form-hint,
html[data-theme="light"] .altiora-contact-counter,
html[data-theme="light"] .altiora-contact-form small {
  color: rgba(12,23,40,.62);
}

html[data-theme="light"] .altiora-legal-panel {
  background: #ffffff;
  color: #0c1728;
  border-color: rgba(25,48,82,.14);
  box-shadow: 0 28px 80px rgba(33,57,93,.18);
}

html[data-theme="light"] .altiora-legal-head,
html[data-theme="light"] .altiora-legal-actions {
  border-color: rgba(25,48,82,.10);
}

html[data-theme="light"] .altiora-legal-body {
  color: rgba(12,23,40,.68);
}

html[data-theme="light"] .altiora-legal-close,
html[data-theme="light"] .altiora-legal-secondary {
  background: rgba(244,248,255,.90);
  border-color: rgba(25,48,82,.14);
  color: #0c1728;
}

@media (max-width: 767px) {
  .altiora-contact-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .altiora-contact-products {
    grid-template-columns: 1fr;
  }

  .altiora-legal-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    top: auto;
    width: auto;
    max-height: calc(100dvh - 20px);
    transform: none;
    border-radius: 22px;
  }

  .altiora-legal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}


/* v82 — legal document placeholders */
.altiora-legal-body h1 {
  margin: 0;
  color: var(--text, #fff);
  font-size: 20px;
  line-height: 1.25;
}

html[data-theme="light"] .altiora-legal-body h1 {
  color: #0c1728;
}


/* v82 — contact form alignment, checkboxes, legal modal sizing and mobile adaptation */
.altiora-contact-form .altiora-field {
  align-content: start;
}

.altiora-contact-form .altiora-field > label:not(.altiora-contact-check) {
  display: flex;
  align-items: center;
  min-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.altiora-contact-form input,
.altiora-contact-form select {
  height: 42px;
}

.altiora-contact-form .altiora-field small[data-error] {
  min-height: 15px;
  display: block;
}

.altiora-contact-products {
  align-items: stretch;
}

.altiora-contact-check {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px !important;
}

.altiora-contact-check input {
  justify-self: start;
}

.altiora-product-check {
  min-height: 42px;
}

.altiora-product-check span,
.altiora-legal-check span {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.altiora-legal-check {
  min-height: 42px;
}

.altiora-legal-checks {
  display: grid !important;
  grid-template-columns: 1fr;
}

.altiora-legal-panel {
  width: min(760px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 32px));
}

.altiora-legal-body {
  font-size: 13px;
  line-height: 1.55;
  padding: 14px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.altiora-legal-body h1 {
  font-size: 18px;
  line-height: 1.25;
}

.altiora-legal-body h2 {
  margin: 18px 0 8px;
  color: var(--text, #fff);
  font-size: 15px;
  line-height: 1.3;
}

.altiora-legal-body p,
.altiora-legal-body li {
  font-size: 13px;
  line-height: 1.55;
}

.altiora-legal-actions {
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .altiora-contact-form {
    gap: 14px;
  }

  .altiora-contact-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .altiora-contact-form .altiora-field > label:not(.altiora-contact-check) {
    min-height: 15px;
    font-size: 11.5px;
  }

  .altiora-contact-form input,
  .altiora-contact-form select {
    height: 40px;
    min-height: 40px;
    font-size: 13px;
  }

  .altiora-contact-form textarea {
    min-height: 86px;
    font-size: 13px;
  }

  .altiora-contact-products {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .altiora-contact-check {
    min-height: 40px;
    padding: 9px 11px !important;
    grid-template-columns: 17px minmax(0, 1fr);
    gap: 9px;
  }

  .altiora-contact-check input {
    width: 15px;
    min-width: 15px;
    height: 15px;
    min-height: 15px;
  }

  .altiora-product-check span,
  .altiora-legal-check span {
    font-size: 12.5px;
  }

  .altiora-form-hint,
  .altiora-contact-counter,
  .altiora-contact-form small {
    font-size: 10.5px;
  }

  .altiora-contact-actions {
    position: sticky;
    bottom: -18px;
    margin: 4px -14px -18px;
    padding: 10px 14px 18px;
    background: #050f20;
    border-top: 1px solid rgba(112,149,210,.14);
    z-index: 4;
  }

  html[data-theme="light"] .altiora-contact-actions {
    background: #ffffff;
    border-color: rgba(25,48,82,.10);
  }

  .altiora-legal-panel {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .altiora-legal-head {
    padding: 14px 14px 10px;
  }

  .altiora-legal-head h3 {
    font-size: 16px;
  }

  .altiora-legal-body {
    padding: 12px 14px;
    font-size: 12.5px;
    line-height: 1.5;
  }

  .altiora-legal-body h1 {
    font-size: 16px;
  }

  .altiora-legal-body h2 {
    font-size: 14px;
  }

  .altiora-legal-body p,
  .altiora-legal-body li {
    font-size: 12.5px;
    line-height: 1.5;
  }

  .altiora-legal-actions {
    padding: 10px 14px 14px;
    grid-template-columns: 1fr;
  }

  .altiora-legal-primary,
  .altiora-legal-secondary {
    width: 100%;
    min-height: 40px;
  }
}

@media (max-width: 380px) {
  .altiora-product-check span,
  .altiora-legal-check span {
    font-size: 12px;
  }

  .altiora-contact-check {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}


/* v90 — legal reject button fix + success window + live validation cleanup */
.altiora-legal-backdrop {
  font-size: 0 !important;
  color: transparent !important;
}

.altiora-legal-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.altiora-contact-success {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: none;
  pointer-events: none;
}

.altiora-contact-success.open {
  display: block;
  pointer-events: auto;
}

.altiora-contact-success::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.26);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.altiora-contact-success-card {
  position: absolute;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 28px));
  border: 1px solid rgba(112,149,210,.22);
  border-radius: 18px;
  background: #050f20;
  color: var(--text, #fff);
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.altiora-contact-success-card p {
  margin: 0;
  color: var(--text, #fff);
  font-size: 15px;
  line-height: 1.45;
}

.altiora-contact-success-card button {
  justify-self: end;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(76,128,255,.56);
  background: rgba(47,128,255,.16);
  color: #9fc2ff;
  padding: 0 15px;
  font: inherit;
  cursor: pointer;
}

html[data-theme="light"] .altiora-contact-success-card {
  background: #ffffff;
  border-color: rgba(25,48,82,.14);
  box-shadow: 0 24px 70px rgba(33,57,93,.20);
}

html[data-theme="light"] .altiora-contact-success-card p {
  color: #0c1728;
}

@media (max-width: 767px) {
  .altiora-contact-success-card {
    top: 12px;
    width: calc(100vw - 20px);
    border-radius: 18px;
    padding: 16px;
  }

  .altiora-contact-success-card button {
    width: 100%;
    justify-self: stretch;
  }
}


/* v90 — center contact success message */
.altiora-contact-success-card {
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
}

@media (max-width: 767px) {
  .altiora-contact-success-card {
    top: 50% !important;
    width: min(420px, calc(100vw - 20px)) !important;
    transform: translate(-50%, -50%) !important;
  }
}


/* v90 — standalone reusable contact modal */
body.has-altiora-contact-modal {
  overflow: hidden;
}

.altiora-contact-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: none;
  pointer-events: none;
}

.altiora-contact-modal.open {
  display: block;
  pointer-events: auto;
}

.altiora-contact-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0,0,0,.50);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0;
  color: transparent;
}

.altiora-contact-modal-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(760px, calc(100vw - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  transform: translate(-50%, -50%);
  border: 1px solid var(--line-2, rgba(112,149,210,.26));
  border-radius: 22px;
  background: #050f20;
  color: var(--text, #fff);
  box-shadow: 0 28px 86px rgba(0,0,0,.48);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.altiora-contact-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line, rgba(255,255,255,.08));
}

.altiora-contact-modal-head h2 {
  margin: 0 0 7px;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.03em;
}

.altiora-contact-modal-head p {
  margin: 0;
  color: var(--muted, rgba(240,244,255,.70));
  font-size: 13px;
  line-height: 1.45;
}

.altiora-contact-modal-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  background: rgba(255,255,255,.06);
  color: var(--text, #fff);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.altiora-contact-modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 20px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

html[data-theme="light"] .altiora-contact-modal-panel {
  background: #ffffff;
  color: #0c1728;
  border-color: rgba(25,48,82,.14);
  box-shadow: 0 28px 86px rgba(33,57,93,.20);
}

html[data-theme="light"] .altiora-contact-modal-head {
  border-color: rgba(25,48,82,.10);
}

html[data-theme="light"] .altiora-contact-modal-head p {
  color: rgba(12,23,40,.62);
}

html[data-theme="light"] .altiora-contact-modal-close {
  background: rgba(244,248,255,.90);
  border-color: rgba(25,48,82,.14);
  color: #0c1728;
}

@media (max-width: 767px) {
  .altiora-contact-modal-panel {
    left: 8px;
    right: 8px;
    bottom: 8px;
    top: 8px;
    width: auto;
    max-height: none;
    transform: none;
    border-radius: 20px;
  }

  .altiora-contact-modal-head {
    padding: 15px 14px 11px;
  }

  .altiora-contact-modal-head h2 {
    font-size: 18px;
  }

  .altiora-contact-modal-head p {
    font-size: 12px;
  }

  .altiora-contact-modal-body {
    padding: 14px 14px 18px;
  }
}


/* v90 — phone in contact form top */
.altiora-contact-phone-top {
  display: flex;
  justify-content: center;
  margin: 0 0 2px;
}

.altiora-contact-phone-top a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  border-radius: 999px;
  color: var(--text, #fff);
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  background: rgba(47,128,255,.10);
}

html[data-theme="light"] .altiora-contact-phone-top a {
  color: #0c1728;
  background: rgba(244,248,255,.86);
  border-color: rgba(25,48,82,.12);
}

@media (max-width: 767px) {
  .altiora-contact-phone-top a {
    width: 100%;
    min-height: 42px;
  }
}


/* v90 — phone belongs to universal contact modal, including product pages */
.altiora-contact-modal-phone {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
}

.altiora-contact-modal-phone a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  border-radius: 999px;
  color: var(--text, #fff);
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  background: rgba(47,128,255,.10);
}

html[data-theme="light"] .altiora-contact-modal-phone a {
  color: #0c1728;
  background: rgba(244,248,255,.86);
  border-color: rgba(25,48,82,.12);
}

@media (max-width: 767px) {
  .altiora-contact-modal-phone {
    margin-bottom: 14px;
  }

  .altiora-contact-modal-phone a {
    width: 100%;
    min-height: 42px;
  }
}


/* v90 — phone is inside form component + hard hidden state */
.altiora-contact-modal[aria-hidden="true"] {
  display: none !important;
  pointer-events: none !important;
}

.altiora-contact-phone-top {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
}

.altiora-contact-phone-top a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  border-radius: 999px;
  color: var(--text, #fff);
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  background: rgba(47,128,255,.10);
}

html[data-theme="light"] .altiora-contact-phone-top a {
  color: #0c1728;
  background: rgba(244,248,255,.86);
  border-color: rgba(25,48,82,.12);
}

@media (max-width: 767px) {
  .altiora-contact-phone-top {
    margin-bottom: 14px;
  }

  .altiora-contact-phone-top a {
    width: 100%;
    min-height: 42px;
  }
}


/* v90 — phone in form plus modal fallback for product pages */
.altiora-contact-phone-top,
.altiora-contact-modal-phone {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
}

.altiora-contact-phone-top a,
.altiora-contact-modal-phone a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  border-radius: 999px;
  color: var(--text, #fff);
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  background: rgba(47,128,255,.10);
}

.altiora-contact-modal-phone[hidden] {
  display: none !important;
}

html[data-theme="light"] .altiora-contact-phone-top a,
html[data-theme="light"] .altiora-contact-modal-phone a {
  color: #0c1728;
  background: rgba(244,248,255,.86);
  border-color: rgba(25,48,82,.12);
}

@media (max-width: 767px) {
  .altiora-contact-phone-top,
  .altiora-contact-modal-phone {
    margin-bottom: 14px;
  }

  .altiora-contact-phone-top a,
  .altiora-contact-modal-phone a {
    width: 100%;
    min-height: 42px;
  }
}
