/*
  Kura Oncology Cognito Forms host page styles
  --------------------------------------------
  This file has three main jobs:
  1. Provide the host page layout: header, title band, form area, footer.
  2. Style optional host-page features: attestation modal and cookie banner.
  3. Override Cognito Forms styles so the embedded form feels native here.

  Kura brand cues observed from the public site:
  - Logo uses deep blue through teal/sky gradients.
  - Footer socket uses a bright teal.
  - Supporting accents include orange, gold, green, and magenta.
  - Public site loads Poppins and Rubik from Google Fonts.
*/

:root {
  /* Typography */
  --font-heading: "Poppins", Arial, Helvetica, sans-serif;
  --font-body: "Rubik", Arial, Helvetica, sans-serif;

  /* Kura-inspired palette */
  --color-deep-blue: #002241;
  --color-navy: #224a7c;
  --color-logo-blue: #006495;
  --color-teal: #0098c5;
  --color-sky: #0090cb;
  --color-orange: #f77c24;
  --color-gold: #ffab2e;
  --color-green: #3cbb76;
  --color-magenta: #c5589c;

  /* Neutrals */
  --color-text: #393c40;
  --color-muted: #6d6f72;
  --color-line: #e0e1e3;
  --color-soft-line: #edf0f2;
  --color-page: #fafafa;
  --color-white: #ffffff;

  /* Shared sizing */
  --container-max: 1120px;
  --radius: 8px;
  --button-radius: 6px;
  --focus-ring: 0 0 0 3px rgba(255, 171, 46, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--color-text);
  background: var(--color-page);
  font-family: var(--font-body);
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-navy);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-teal);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.container {
  width: calc(100% - 32px);
  max-width: var(--container-max);
  margin-right: auto;
  margin-left: auto;
}

.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;
  padding: 10px 14px;
  color: var(--color-white);
  background: var(--color-deep-blue);
  border-radius: var(--button-radius);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header */

.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-soft-line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  border-radius: var(--button-radius);
}

.brand-logo {
  width: 280px;
  height: auto;
}

.header-meta {
  flex: 0 0 auto;
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: right;
}

.brand-accent {
  display: grid;
  grid-template-columns: 4fr 1fr 1fr 1fr 1fr;
  height: 6px;
}

.brand-accent span {
  min-width: 0;
}

.accent-teal {
  background: var(--color-teal);
}

.accent-orange {
  background: var(--color-orange);
}

.accent-gold {
  background: var(--color-gold);
}

.accent-green {
  background: var(--color-green);
}

.accent-magenta {
  background: var(--color-magenta);
}

/* Title band */

.title-band {
  color: var(--color-white);
  background: var(--color-teal);
  border-bottom: 6px solid var(--color-gold);
}

.title-band-inner {
  padding-top: 42px;
  padding-bottom: 46px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
}

.title-band h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--font-heading);
  font-size: 2.1rem;
  line-height: 1.18;
  font-weight: 700;
}

.title-copy {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--color-white);
  font-size: 1.05rem;
}

/* Form area */

.form-band {
  padding-top: 36px;
  padding-bottom: 48px;
  background: var(--color-page);
}

.form-shell {
  padding: 28px;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-top: 6px solid var(--color-teal);
  border-radius: var(--radius);
}

.cognito-form-host {
  min-height: 420px;
}

/* Footer */

.site-footer {
  color: var(--color-white);
  background: var(--color-navy);
}

.footer-inner {
  display: grid;
  gap: 20px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.footer-inner p {
  max-width: 920px;
  margin: 0;
}

.site-footer a,
.site-footer .text-button {
  color: var(--color-white);
}

.site-footer a:hover,
.site-footer .text-button:hover {
  color: var(--color-gold);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}

.text-button {
  display: inline;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  background: transparent;
  border: 0;
  border-radius: var(--button-radius);
}

.footer-socket {
  background: var(--color-teal);
}

.footer-socket p {
  margin: 0;
  padding-top: 14px;
  padding-bottom: 14px;
  font-size: 0.9rem;
  text-align: center;
}

/* Shared buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 10px 18px;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  border: 2px solid transparent;
  border-radius: var(--button-radius);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.button-primary {
  color: var(--color-white);
  background: var(--color-teal);
  border-color: var(--color-teal);
}

.button-primary:hover {
  color: var(--color-white);
  background: var(--color-navy);
  border-color: var(--color-navy);
}

.button-secondary {
  color: var(--color-navy);
  background: var(--color-white);
  border-color: var(--color-line);
}

.button-secondary:hover {
  color: var(--color-white);
  background: var(--color-navy);
  border-color: var(--color-navy);
}

/* Attestation modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 34, 65, 0.74);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-panel {
  width: 100%;
  min-width: 0;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--color-white);
  border-radius: var(--radius);
}

.modal-accent {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  height: 8px;
  background: var(--color-teal);
}

.modal-accent::before,
.modal-accent::after {
  content: "";
}

.modal-content {
  min-width: 0;
  padding: 28px;
  overflow-wrap: break-word;
}

.modal-kicker {
  margin: 0 0 8px;
  color: var(--color-teal);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.modal-content h2 {
  margin: 0 0 16px;
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: 1.55rem;
  line-height: 1.25;
}

.modal-message p {
  margin: 0 0 14px;
}

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

.modal-actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

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

/* Cookie consent */

.cookie-consent {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 8000;
  color: var(--color-white);
  background: var(--color-deep-blue);
  border-top: 5px solid var(--color-gold);
}

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

body.modal-open .cookie-consent {
  display: none;
}

.cookie-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding-top: 18px;
  padding-bottom: 18px;
}

.cookie-inner p {
  margin: 0;
  font-size: 0.95rem;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

/* Cognito Forms overrides
   -----------------------
   Cognito's V2 CSS intentionally has high specificity. The body id
   (#kura-webform-host) keeps these overrides specific without resorting to
   blanket !important declarations. Keep Cognito selectors under this section.
*/

#kura-webform-host .cog-cognito {
  --font-family: var(--font-body);
  --header__font-family: var(--font-heading);
  --label__font-family: var(--font-heading);
  --button-primary__font-family: var(--font-heading);
  --button-secondary__font-family: var(--font-heading);
  --input__background-color: var(--color-white);
  --checkable__background-color: var(--color-white);
  --highlight: var(--color-teal);
  --highlight-reverse: var(--color-white);
  --negative: #ffe1dc;
  --negative-reverse: #8a1f11;
  --form__margins: 0;
  color: var(--color-text);
  font-family: var(--font-body);
}

#kura-webform-host .cog-cognito *,
#kura-webform-host .cog-cognito *::before,
#kura-webform-host .cog-cognito *::after {
  letter-spacing: 0;
}

#kura-webform-host .cog-heading,
#kura-webform-host .cog-header,
#kura-webform-host .cog-content h1,
#kura-webform-host .cog-content h2,
#kura-webform-host .cog-content h3 {
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-weight: 700;
}

#kura-webform-host .cog-label,
#kura-webform-host .cog-legend,
#kura-webform-host .cog-field__label {
  color: var(--color-deep-blue);
  font-family: var(--font-heading);
  font-weight: 600;
}

#kura-webform-host .cog-asterisk {
  color: var(--negative-reverse);
  font-weight: 700;
}

#kura-webform-host .cog-field input,
#kura-webform-host .cog-field select,
#kura-webform-host .cog-field textarea,
#kura-webform-host .el-input__inner,
#kura-webform-host .el-textarea__inner {
  color: var(--color-text);
  background-color: var(--color-white);
  border-color: #c2c3c4;
  border-radius: var(--button-radius);
}

#kura-webform-host .cog-field input:focus,
#kura-webform-host .cog-field select:focus,
#kura-webform-host .cog-field textarea:focus,
#kura-webform-host .el-input__inner:focus,
#kura-webform-host .el-textarea__inner:focus {
  border-color: var(--color-teal);
  box-shadow: var(--focus-ring);
}

#kura-webform-host .cog-button {
  min-height: 44px;
  padding-right: 20px;
  padding-left: 20px;
  font-family: var(--font-heading);
  font-weight: 700;
  border-radius: var(--button-radius);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

#kura-webform-host .cog-button--primary,
#kura-webform-host .cog-button--submit,
#kura-webform-host .cog-button--next {
  color: var(--color-white);
  background-color: var(--color-teal);
  border-color: var(--color-teal);
}

#kura-webform-host .cog-button--primary:hover,
#kura-webform-host .cog-button--submit:hover,
#kura-webform-host .cog-button--next:hover {
  color: var(--color-white);
  background-color: var(--color-navy);
  border-color: var(--color-navy);
}

#kura-webform-host .cog-button--secondary,
#kura-webform-host .cog-button--back,
#kura-webform-host .cog-button--save {
  color: var(--color-navy);
  background-color: var(--color-white);
  border-color: var(--color-line);
}

#kura-webform-host .cog-button--secondary:hover,
#kura-webform-host .cog-button--back:hover,
#kura-webform-host .cog-button--save:hover {
  color: var(--color-white);
  background-color: var(--color-navy);
  border-color: var(--color-navy);
}

#kura-webform-host .cog-page__navigation {
  justify-content: flex-start;
  gap: 12px;
}

#kura-webform-host .cog-error-message {
  color: #8a1f11;
  background: #ffe1dc;
  border-radius: var(--button-radius);
}

#kura-webform-host .cog-field.is-error input,
#kura-webform-host .cog-field.is-error select,
#kura-webform-host .cog-field.is-error textarea,
#kura-webform-host .cog-field.is-error .el-input__inner,
#kura-webform-host .cog-field.is-error .el-textarea__inner {
  border-color: #de5a49;
}

/* Responsive adjustments */

@media (max-width: 760px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .brand-logo {
    width: 240px;
  }

  .header-meta {
    text-align: left;
  }

  .title-band-inner {
    padding-top: 34px;
    padding-bottom: 36px;
  }

  .title-band h1 {
    font-size: 1.75rem;
  }

  .form-shell {
    padding: 18px;
  }

  .cookie-inner {
    grid-template-columns: 1fr;
  }

  .cookie-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 460px) {
  .container {
    width: calc(100% - 24px);
  }

  .brand-logo {
    width: 220px;
  }

  .title-band h1 {
    font-size: 1.55rem;
  }

  .title-copy {
    font-size: 1rem;
  }

  .form-band {
    padding-top: 24px;
    padding-bottom: 36px;
  }

  .form-shell {
    padding: 14px;
  }

  .modal-overlay {
    padding: 12px;
  }

  .modal-panel {
    max-height: calc(100vh - 24px);
  }

  .modal-content {
    padding: 20px;
  }

  .button,
  #kura-webform-host .cog-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
