/* =========================================================
   Oris Maritime — Contact form + Modal
   Centralized form component + unified modal shell
   ========================================================= */

/* ---------- Modal shell ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px 40px;
  overflow: hidden;
  pointer-events: none;
}
.modal.is-open {
  pointer-events: auto;
  overflow-y: auto;
}

.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 15, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 380ms var(--ease-out);
}
.modal.is-open .modal__backdrop { opacity: 1; }

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 820px;
  background: var(--navy-900);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  padding: clamp(32px, 4vw, 56px) clamp(24px, 4vw, 64px);
  margin-block: auto;
  transform: translateY(32px);
  opacity: 0;
  transition:
    opacity 380ms var(--ease-out),
    transform 420ms var(--ease-out);
}
.modal.is-open .modal__dialog {
  opacity: 1;
  transform: translateY(0);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.modal__head {
  margin-bottom: var(--space-xl);
  padding-right: 48px;
}
.modal__head .eyebrow { display: block; margin-bottom: var(--space-sm); }
.modal__title {
  font-weight: 200;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--white);
}
.modal__title em {
  font-style: italic;
  font-weight: 300;
  color: var(--steel-300);
}
.modal__sub {
  margin-top: var(--space-sm);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.5;
  color: var(--steel-300);
  max-width: 54ch;
}

body.is-modal-open { overflow: hidden; }

@media (max-width: 720px) {
  .modal { padding: 60px 12px 24px; }
  .modal__dialog { padding: 56px 20px 28px; }
  .modal__head { padding-right: 0; margin-bottom: var(--space-lg); }
}

/* ---------- Contact form (.cform) ---------- */
.cform { display: block; }

.cform__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--space-xl);
  row-gap: clamp(28px, 3vw, 40px);
}
.cform__field--full { grid-column: 1 / -1; }

@media (max-width: 720px) {
  .cform__grid {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: var(--space-lg);
  }
}

.cform__field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cform__label {
  font-size: 14px;
  font-weight: 400;
  color: var(--steel-200);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.cform__label .req {
  color: var(--accent);
  margin-left: 2px;
}

.cform__input {
  width: 100%;
  display: block;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--white);
  font: 400 16px/1.5 var(--font-sans);
  letter-spacing: -0.005em;
  padding: 10px 0 12px;
  border-radius: 0;
  transition: border-color 240ms var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.cform__input::placeholder {
  color: var(--steel-500);
  opacity: 1;
}
.cform__input:hover { border-bottom-color: var(--steel-300); }
.cform__input:focus {
  outline: none;
  border-bottom-color: var(--white);
}
.cform__input--ta {
  resize: vertical;
  min-height: 88px;
  padding-top: 12px;
  font-family: var(--font-sans);
}

/* Autofill — keep navy bg, not the browser yellow */
.cform__input:-webkit-autofill,
.cform__input:-webkit-autofill:hover,
.cform__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--white);
  -webkit-box-shadow: 0 0 0 1000px var(--navy-700) inset;
  caret-color: var(--white);
  transition: background-color 9999s ease-in-out 0s;
}

/* Native :invalid styling only after user interaction */
.cform__input:user-invalid {
  border-bottom-color: var(--accent);
}
.cform__field--error .cform__label { color: var(--accent); }
.cform__field--error .cform__input { border-bottom-color: var(--accent); }

/* Foot row */
.cform__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: clamp(28px, 3vw, 40px);
  flex-wrap: wrap;
}
.cform__note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel-500);
  max-width: 36ch;
  line-height: 1.6;
}
.cform__submit {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  min-width: 180px;
  justify-content: center;
  font-weight: 600;
}
.cform__submit:hover {
  background: var(--white);
  color: var(--navy-800);
  border-color: var(--white);
}
.cform__submit[disabled] {
  opacity: 0.55;
  cursor: progress;
}

@media (max-width: 540px) {
  .cform__foot { flex-direction: column; align-items: stretch; }
  .cform__submit { width: 100%; }
  .cform__note { order: 2; text-align: center;max-width: unset; }
}

/* ---------- Inline success state ---------- */
.cform-success {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg) 0 var(--space-sm);
}
.cform-success.is-shown { display: flex; }

.cform-success__mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(73, 197, 134, 0.12);
  border: 1px solid rgba(73, 197, 134, 0.4);
  color: #49C586;
  position: relative;
}
.cform-success__mark svg {
  width: 28px;
  height: 28px;
  stroke-dasharray: 32;
  stroke-dashoffset: 32;
  animation: cfCheck 600ms 220ms var(--ease-out) forwards;
}
@keyframes cfCheck {
  to { stroke-dashoffset: 0; }
}

.cform-success__title {
  font-weight: 300;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--white);
}
.cform-success__desc {
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  color: var(--steel-300);
  max-width: 50ch;
}
.cform-success__meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel-500);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--line);
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.cform-success__meta a { color: var(--steel-200); transition: color 200ms; }
.cform-success__meta a:hover { color: var(--white); }

/* hide form once success is shown */
.cform.is-submitted { display: none; }

/* ---------- Page section variant (contacts page) ---------- */
.contact-section {
  position: relative;
}
.contact-section__grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) {
  .contact-section__grid { grid-template-columns: 1fr; gap: var(--space-xl); }
}

.contact-section__head .eyebrow {
  display: block;
  margin-bottom: var(--space-md);
}
.contact-section__title {
  font-weight: 200;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: var(--space-md);
}
.contact-section__title em {
  font-style: italic;
  font-weight: 300;
  color: var(--steel-300);
}
.contact-section__lede {
  font-weight: 300;
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.55;
  color: var(--steel-200);
  max-width: 42ch;
  margin-bottom: var(--space-xl);
}
.contact-section__channels {
  display: grid;
  gap: var(--space-md);
  border-top: 1px solid var(--line);
  padding-top: var(--space-lg);
}
.contact-section__channel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.contact-section__channel .meta {
  display: block;
}
.contact-section__channel a {
  font-size: 16px;
  font-weight: 400;
  color: var(--white);
  letter-spacing: -0.005em;
  transition: color 200ms;
}
.contact-section__channel a:hover { color: var(--accent); }

.contact-section__form-wrap {
  background: var(--navy-800);
  border: 1px solid var(--line);
  padding: clamp(32px, 4vw, 56px);
}

/* ---------- Contact Form 7 — match .cform visual style ---------- */
.wpcf7 { display: block; }

.wpcf7-form .wpcf7-form-control-wrap {
  display: block;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form textarea {
  width: 100%;
  display: block;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--white);
  font: 400 16px/1.5 var(--font-sans);
  letter-spacing: -0.005em;
  padding: 10px 0 12px;
  border-radius: 0;
  transition: border-color 240ms var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.wpcf7-form input[type="text"]:hover,
.wpcf7-form input[type="email"]:hover,
.wpcf7-form input[type="tel"]:hover,
.wpcf7-form input[type="url"]:hover,
.wpcf7-form textarea:hover {
  border-bottom-color: var(--steel-300);
}
.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form input[type="tel"]:focus,
.wpcf7-form input[type="url"]:focus,
.wpcf7-form textarea:focus {
  outline: none;
  border-bottom-color: var(--white);
}
.wpcf7-form textarea {
  resize: vertical;
  min-height: 88px;
  padding-top: 12px;
  font-family: var(--font-sans);
}

/* Autofill */
.wpcf7-form input:-webkit-autofill,
.wpcf7-form input:-webkit-autofill:hover,
.wpcf7-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--white);
  -webkit-box-shadow: 0 0 0 1000px var(--navy-700) inset;
  caret-color: var(--white);
  transition: background-color 9999s ease-in-out 0s;
}

/* Validation errors */
.wpcf7-not-valid {
  border-bottom-color: var(--accent) !important;
}
.wpcf7-not-valid-tip {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--accent);
  line-height: 1.3;
}

/* Hide CF7 ajax spinner — we use a CSS loader instead */
.wpcf7-spinner { display: none !important; }

/* Spinner lives in .arrow::before — always sized, invisible at rest */
.cform__submit .arrow::before {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  opacity: 0;
  animation: cf7-spin 600ms linear infinite;
}
.cform__submit br{display: none;}
.wpcf7-form.submitting .cform__submit .arrow {
  background: transparent;
}
.wpcf7-form.submitting .cform__submit .arrow::after { opacity: 0; }
.wpcf7-form.submitting .cform__submit .arrow::before { opacity: 1; }

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

/* Response output — hidden, CF7 handles state via AJAX classes */
.wpcf7-response-output {
  display: none !important;
}
