/* 1. GLOBAL STYLES */

:root {
  --color-primary: #002e5d;
  --color-primary-hover: #245a78;
  --color-accent: #3b9298;
  --color-background: #f5f7fa;
  --color-surface: #ffffff;
  --color-text: #243044;
  --color-muted: #586579;
  --color-border: #d8dfe7;
  --color-focus: #287eaa;

  --radius-sm: 6px;
  --radius-lg: 14px;

  --shadow-card: 0 6px 28px rgba(0, 0, 0, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-background);
}

button,
input,
select,
a {
  font: inherit;
}

a {
  color: var(--color-primary);
}

[hidden][hidden] {
  display: none;
}

.required {
  color: red;
  font-size: 1.1rem;
}

/*SITE HEADER */

.site-header {
  background: var(--color-primary);
  color: #ffffff;
}

.header-content {
  max-width: 1500px;
  margin: 0 auto;
  padding: 10px;
  display: flex;
  align-items: end;
  justify-content: space-around;
  gap: 20px;
}

.login-link {
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  padding-bottom: 20px;
}

.login-link:hover {
  text-decoration: underline;
}

/*PAGE LAYOUT AND CARD */

.registration-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 44px 20px 64px;
}

.registration-card {
  padding: 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 5px solid #26c485;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.form-heading {
  position: relative;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.form-heading h1 {
  margin: 0;
  font-size: 30px;
  color: var(--color-primary);
}

.form-heading p {
  margin: 0;
  color: var(--color-muted);
  padding-bottom: 1rem;
}

.required-note {
  display: block;
  font-size: 12px;
  text-align: right;
  color: var(--color-muted);
}

/*FORM SECTIONS */

.form-section {
  min-width: 0;
  margin: 2rem 0;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid var(--color-border);
}

.form-section legend {
  padding: 0;
  margin-bottom: 2px;
  color: var(--color-primary);
  font-size: 19px;
  font-weight: 700;
}

.section-description {
  margin: 0 0 22px;
  color: var(--color-muted);
  font-size: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-group {
  min-width: 0;
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.optional {
  color: var(--color-muted);
  font-weight: 400;
}

/*INPUTS AND SELECTS */

.form-group input,
.form-group select {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  background: #ffffff;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-group input::placeholder {
  color: #929ba8;
}

.form-group input:hover,
.form-group select:hover {
  border-color: #9eafbd;
}

.form-group input:focus,
.form-group select:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
  border-color: var(--color-focus);
}

.form-group input:disabled,
.form-group select:disabled {
  background: #f0f2f5;
  cursor: not-allowed;
}

/* Tom Select - match standard form fields */

.form-group .ts-wrapper.single .ts-control {
  min-height: 46px;
  padding: 11px 13px;
  background: #ffffff;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: none;
  font-size: 16px;
  line-height: 1.5;
}

.form-group .ts-wrapper.single .ts-control:hover {
  border-color: #9eafbd;
}

.form-group .ts-wrapper.focus .ts-control {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
  border-color: var(--color-focus);
  box-shadow: none;
}

.form-group .ts-dropdown {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.form-group .ts-wrapper.has-items .ts-control {
  background-color: #e8f0fe;
}

#enrollment-form .form-group input[placeholder=" "]:not(:placeholder-shown):valid:not(:disabled) {
  background-color: #e8f0fe;
}

/*WORK EMAIL EXPLANATION */

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.info-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.info-toggle:hover {
  text-decoration: underline;
}

.info-toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
}

/* SHARED INFORMATION MESSAGE STYLING */

.info-message,
.email-reminder-content {
  padding: 14px 16px;
  background: #e5f8ee;
  border-left: 3px solid #26c485;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.6;
}

.info-message {
  margin-bottom: 12px;
}

/*PREFERRED CONTACT EMAIL */

.contact-preference {
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

.contact-preference legend {
  margin-bottom: 6px;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 700;
}

.contact-preference p {
  margin: 0 0 14px;
  color: var(--color-muted);
  font-size: 14px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.radio-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.radio-option label {
  font-size: 14px;
  cursor: pointer;
}

.radio-option input:disabled,
.radio-option input:disabled + label {
  opacity: 0.5;
  cursor: not-allowed;
}

/*ANIMATED EMAIL REMINDER */

.email-reminder {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.35s ease,
    opacity 0.35s ease;
}

.email-reminder-content {
  min-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  border-bottom-width: 0;
  transition: padding 0.35s ease;
}

.email-reminder.visible {
  grid-template-rows: 1fr;
  opacity: 1;
}

.email-reminder.visible .email-reminder-content {
  padding-top: 14px;
  padding-bottom: 14px;
}

.email-reminder h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--color-primary);
}

.email-reminder p {
  margin: 0;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.6;
}

.email-reminder strong {
  color: var(--color-primary);
  overflow-wrap: anywhere;
}

/*REVIEW AND SUBMIT */

.submit-section {
  padding-bottom: 0;
  border-bottom: 0;
}

.submit-section h3 {
  margin: 0 0 18px;
  color: var(--color-primary);
  font-size: 19px;
}

.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 26px;
}

.checkbox-option input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.checkbox-option label {
  font-size: 14px;
  line-height: 1.6;
}

.privacy-link {
  font-weight: 600;
}

.submit-button {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 20px;
  background: var(--color-primary);
  color: #ffffff;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.submit-button:hover {
  background: var(--color-primary-hover);
}

.submit-button:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.form-disclaimer {
  margin: 14px 0 0;
  color: var(--color-muted);
  font-size: 12px;
  text-align: center;
}

.message {
  padding-bottom: 1rem;
}

/* PRIMARY AND SECONDARY SPECIALTY CARDS */

.specialty-card {
  margin-top: 22px;
  padding: 22px;
  background: #fafafa;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.specialty-card .area-of-care-heading {
  margin: 0 0 6px;
  color: var(--color-primary);
  font-size: 18px;
}

.specialty-description {
  margin: 0 0 20px;
  color: var(--color-muted);
  font-size: 14px;
}

.specialty-card .form-group:last-child {
  margin-bottom: 0;
}

/* Registration confirmation page */

.registration-confirmation {
  text-align: center;
}

.confirmation-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: #e5f8ee;
  color: var(--color-primary);
}

.confirmation-heading {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--color-border);
}

.confirmation-heading h1 {
  max-width: 560px;
  margin: 0 auto 16px;
  color: var(--color-primary);
  font-size: clamp(24px, 4vw, 30px);
  line-height: 1.25;
}

.confirmation-heading p {
  max-width: 500px;
  margin: 0 auto;
  color: var(--color-muted);
}

.confirmation-next-step {
  padding: 30px 0 24px;
}

.confirmation-next-step h2 {
  margin: 0 0 18px;
  color: #26c485;
  font-size: 28px;
  line-height: 1.4;
}

.confirmation-next-step p {
  margin: 0 0 16px;
}

.confirmation-email {
  color: var(--color-primary);
  font-size: 19px;
  overflow-wrap: anywhere;
}

.confirmation-detail,
.confirmation-help {
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.6;
}

.confirmation-help {
  margin: 0 0 18px;
}

.confirmation-home {
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  text-underline-offset: 3px;
}

.email-confirmation-button {
max-width: 300px;
margin: 2rem auto;
}

/* Dialog modal */

.enrollment-dialog {
  box-sizing: border-box;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 32px;
  overflow-y: auto;
  border: none;
  border-top: 5px solid #26c485;
  border-radius: 16px;
  background: #fff;
  color: #243044;
  font-family: inherit;
  text-align: left;
  box-shadow: 0 20px 60px rgb(0 0 0 / 25%);
}

.enrollment-dialog::backdrop {
  background: rgb(0 25 50 / 55%);
}

.enrollment-dialog h2 {
  margin: 0 0 16px;
  color: #002e5d;
  font-size: 1.5rem;
  line-height: 1.25;
}

.enrollment-dialog p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
}

.enrollment-dialog p + p {
  margin-top: 16px;
}

.enrollment-dialog .dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.enrollment-dialog .dialog-actions form {
  margin: 0;
  padding: 0;
}

.enrollment-dialog .dialog-actions a,
.enrollment-dialog .dialog-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  width: auto;
  margin: 0;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.enrollment-dialog .dialog-actions a {
  background: #002e5d;
  color: #fff;
}

.enrollment-dialog .dialog-actions a:hover {
  background: #004477;
}

.enrollment-dialog .dialog-actions button {
  background: #f0f4f7;
  color: #243044;
}

.enrollment-dialog .dialog-actions button:hover {
  background: #e2e9ef;
}

.enrollment-dialog .dialog-actions a:focus-visible,
.enrollment-dialog .dialog-actions button:focus-visible {
  outline: 3px solid #3b9298;
  outline-offset: 3px;
}

/* SITE FOOTER */

.end-p {
  text-align: center;
}

.site-footer {
  background: var(--color-primary);
  color: #ffffff;
  padding: 35px 20px 40px;
}

.footer-content {
  max-width: 1250px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: 320px 250px 1fr;
  column-gap: 25px;
  align-items: end;
}

.footer-logo {
  display: block;
  width: 390px;
  max-width: 100%;
  height: auto;
  margin-bottom: 28px;
}

.footer-contact p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.5;
}

.footer-contact a,
.footer-links a {
  color: #ffffff;
  text-decoration: none;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  align-self: flex-end;
}

.footer-links a {
  font-size: 16px;
}

.footer-links a:hover,
.footer-contact a:hover {
  text-decoration: underline;
}

.footer-copyright {
  justify-self: end;
  font-size: 14px;
}

.footer-copyright p {
  margin: 0;
}

/*RESPONSIVE DESIGN */

@media (max-width: 600px) {
  .header-content {
    padding: 16px 20px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
  }

  .logo {
    align-self: flex-start;
    max-width: 100%;
  }

  .logo img {
    display: block;
    width: 300px;
    max-width: 100%;
    height: auto;
  }

  .login-link {
    align-self: flex-end;
    padding-bottom: 0;
  }

  .registration-container {
    padding: 28px 16px 40px;
  }

  .registration-card {
    padding: 24px 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-section {
    padding: 24px 0;
  }

  .form-section legend {
    font-size: 18px;
  }

  .site-footer {
    padding: 30px 20px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 25px;
    text-align: center;
  }


  .footer-logo {
    width: 300px;
    max-width: 100%;
    margin: 0 auto;
  }

  .footer-copyright {
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms;
  }
}
