/* ==========================================================================
   MedEntry error styles
   - .me-alert  : Option 1 "Soft tint" error message
   - .me-field  : Option B "Tinted field" inline error
   Assumes Montserrat is already loaded on the site.
   ========================================================================== */

:root {
  --me-error-50:  #fef3f2;  /* alert / field background */
  --me-error-100: #fee4e2;  /* icon badge */
  --me-error-200: #fecdca;  /* alert border */
  --me-error-300: #fda29b;  /* field border */
  --me-error-600: #d92d20;  /* icons */
  --me-error-700: #b42318;  /* links, inline message text */
  --me-error-800: #912018;  /* alert body text */
  --me-error-900: #7a271a;  /* titles, field label */

  --me-text:        #1f2328;
  --me-border:      #c9ccd1;
  --me-focus-ring:  rgba(217, 45, 32, 0.25);
  --me-radius:      12px;
  --me-radius-sm:   8px;
  --me-font:        Montserrat, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Option 1 — Soft tint alert
   -------------------------------------------------------------------------- */

.me-alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 24px;
  padding: 16px 12px 16px 16px;
  background: var(--me-error-50);
  border: 1px solid var(--me-error-200);
  border-radius: var(--me-radius);
  font-family: var(--me-font);
  color: var(--me-error-800);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.me-alert__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--me-error-100);
  color: var(--me-error-600);
}

.me-alert__icon svg {
  width: 20px;
  height: 20px;
}

.me-alert__content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 7px; /* optically centres the title with the 36px badge */
}

.me-alert__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--me-error-900)!important;
  margin-bottom: 0px!important;
  
}

.me-alert__body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.me-alert__list {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.7;
}
.me-alert__list li {
  list-style-type: disc!important;
}

.me-alert a {
  color: var(--me-error-700);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.me-alert a:hover {
  color: var(--me-error-900);
}

.me-alert__close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;               /* comfortable touch target */
  height: 44px;
  margin: -4px 0;
  padding: 0;
  border: 0;
  border-radius: var(--me-radius-sm);
  background: transparent;
  color: var(--me-error-700);
  cursor: pointer;
}

.me-alert__close svg {
  width: 18px;
  height: 18px;
}

.me-alert__close:hover {
  background: var(--me-error-100);
}

.me-alert__close:focus-visible {
  outline: 2px solid var(--me-error-600);
  outline-offset: 2px;
}

/* State set by me-errors.js while the alert is closing */
.me-alert.is-dismissing {
  opacity: 0;
  transform: translateY(-4px);
}

/* --------------------------------------------------------------------------
   Option B — Tinted inline field error
   -------------------------------------------------------------------------- */

.me-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  font-family: var(--me-font);
}

.me-field__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--me-text);
}

.me-field__control {
  position: relative;
  display: flex;
}

.me-field__input {
  flex: 1 1 auto;
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--me-border);
  border-radius: var(--me-radius-sm);
  background: #ffffff;
  font-family: inherit;
  font-size: 15px;
  color: var(--me-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.me-field__input:focus {
  outline: none;
  border-color: #8a8f98;
  box-shadow: 0 0 0 4px rgba(31, 35, 40, 0.08);
}

.me-field__icon {
  display: none;
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--me-error-600);
  pointer-events: none;
}

.me-field__icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.me-field__error {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--me-error-700);
}

/* Error state */
.me-field.has-error .me-field__label {
  color: var(--me-error-900);
}

.me-field.has-error .me-field__input {
  padding-right: 44px; /* room for the icon */
  border-color: var(--me-error-300);
  background: var(--me-error-50);
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.08);
}

.me-field.has-error .me-field__input:focus {
  border-color: var(--me-error-600);
  box-shadow: 0 0 0 4px var(--me-focus-ring);
}

.me-field.has-error .me-field__icon {
  display: block;
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .me-alert,
  .me-field__input {
    transition: none;
  }
}
