:root {
  --mira-blue: #022eda;
  --mira-blue-dark: #00134f;
  --mira-yellow: #ffdb16;
  --white: #fff;
  --grid-size: 44px;
  --grid-line: rgba(112, 151, 255, 0.15);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-lg: 26px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--white);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: var(--mira-blue);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  background-repeat: repeat;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

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

/* ---------- reveal on scroll ---------- */
.page-motion .reveal-on-scroll {
  opacity: 0;
  filter: blur(5px);
  translate: 0 32px;
  scale: 0.985;
  will-change: opacity, filter, translate, scale;
}

.page-motion .reveal-on-scroll.is-visible {
  animation: reveal-in 780ms var(--ease-out) both;
  animation-delay: var(--reveal-delay, 0ms);
}

@keyframes reveal-in {
  from { opacity: 0; filter: blur(5px); translate: 0 32px; scale: 0.985; }
  to   { opacity: 1; filter: blur(0); translate: 0 0; scale: 1; }
}

/* ---------- hero ---------- */
.representatives-hero {
  position: relative;
  padding: clamp(24px, 3vw, 42px) 0 clamp(24px, 3vw, 38px);
  overflow: hidden;
}

.representatives-hero__intro {
  width: min(1400px, calc(100% - 8vw));
  margin: 0 auto;
  text-align: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 13px;
  color: var(--mira-yellow);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.kicker span { width: 32px; height: 2px; background: currentColor; }

.representatives-hero__intro h1 {
  margin: 0 auto;
  max-width: 20ch;
  font-family: "Manrope", sans-serif;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.95;
  color: #fff !important;
}
.representatives-hero__intro h1 span { color: #fff !important; }
.representatives-hero__intro h1 strong { color: var(--mira-yellow) !important; font-weight: 800; }

.representatives-hero__lead {
  max-width: 56ch;
  margin: 12px auto 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(0.9rem, 1vw, 1.02rem);
  line-height: 1.5;
}


/* ---------- search panel ---------- */
.representatives-directory__layout {
  display: grid;
  grid-template-columns: minmax(230px, 270px) minmax(0, 1fr);
  grid-template-areas:
    "summary summary"
    "filters results";
  gap: clamp(22px, 3vw, 42px);
  align-items: start;
  width: min(1500px, calc(100% - 8vw));
  margin: 0 auto clamp(70px, 8vw, 120px);
}

.search-panel {
  z-index: 5;
  grid-area: filters;
  position: sticky;
  top: 88px;
  width: auto;
  margin: 0;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(0, 19, 79, 0.72);
  box-shadow: 0 20px 54px rgba(0, 4, 36, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.eyebrow__line { display: block; width: 32px; height: 2px; background: var(--mira-yellow); }

.search-mode {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-mode__option {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}
.search-mode__option input {
  appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 200ms ease;
}
.search-mode__option input::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 150ms var(--ease-out);
  background: var(--mira-yellow);
}
.search-mode__option input:checked {
  border-color: var(--mira-yellow);
}
.search-mode__option input:checked::before { transform: scale(1); }

.search-form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
}
.search-form__grid--single { grid-template-columns: minmax(0, 1fr); }

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.field select,
.field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(4, 12, 48, 0.55);
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 200ms ease, background 200ms ease;
  appearance: none;
  -webkit-appearance: none;
}

/* The active theme may override form controls with dark text/backgrounds. */
body .mira-representatives-directory .search-form .field select,
body .mira-representatives-directory .search-form .field input,
body .mira-representatives-directory .search-form .field select:focus,
body .mira-representatives-directory .search-form .field input:focus,
body .mira-representatives-directory .search-form .field input:active {
	box-sizing: border-box !important;
	height: 42px !important;
	padding: 0 12px !important;
	border: 1px solid rgba(255, 255, 255, 0.22) !important;
	border-radius: 12px !important;
	font-family: "DM Sans", sans-serif !important;
	font-size: 0.82rem !important;
	font-weight: 400 !important;
	line-height: normal !important;
  color: #fff !important;
  background-color: rgba(4, 12, 48, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: var(--mira-yellow) !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

body .mira-representatives-directory .search-form .field select:focus,
body .mira-representatives-directory .search-form .field input:focus {
  background-color: rgba(4, 12, 48, 0.78) !important;
  border-color: var(--mira-yellow) !important;
}

body .mira-representatives-directory .search-form .field select option {
  color: #06216c !important;
  background: #fff !important;
  -webkit-text-fill-color: #06216c !important;
}

body .mira-representatives-directory .search-form .field select {
	padding-right: 38px !important;
}

body .mira-representatives-directory .search-form .field input::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.4) !important;
}

body .mira-representatives-directory .search-form .field input:-webkit-autofill,
body .mira-representatives-directory .search-form .field input:-webkit-autofill:hover,
body .mira-representatives-directory .search-form .field input:-webkit-autofill:focus {
	-webkit-text-fill-color: #fff !important;
	-webkit-box-shadow: 0 0 0 1000px rgba(4, 12, 48, 0.78) inset !important;
	box-shadow: 0 0 0 1000px rgba(4, 12, 48, 0.78) inset !important;
}

.field select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffdb16' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 38px;
}
.field select option { color: #06216c; }

.field select:disabled,
.field input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.field select:focus,
.field input:focus {
  border-color: var(--mira-yellow);
  background: rgba(4, 12, 48, 0.78);
}

.field input::placeholder { color: rgba(255, 255, 255, 0.4); }

.search-form__actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-direction: column;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  padding: 0 18px;
  border: none;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 300ms var(--ease-out), background 250ms ease, box-shadow 250ms ease, color 250ms ease;
}
.btn--primary {
  color: #052479;
  background: var(--mira-yellow);
  box-shadow: 0 10px 26px rgba(0, 8, 47, 0.28);
}
.btn--primary:hover { background: #ffe64f; transform: translateY(-2px); }
.btn--ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-2px); }

.is-hidden { display: none !important; }

/* ---------- results ---------- */
.results {
  grid-area: results;
  width: auto;
  margin: 0;
}

.directory-summary {
  grid-area: summary;
}

.results__count {
  text-align: left;
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.results__count span { color: var(--mira-yellow); font-weight: 800; font-size: 1rem; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}

.rep-card {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  background: linear-gradient(155deg, #022eda 0%, #00134f 88%);
  box-shadow: 0 20px 50px rgba(0, 4, 37, 0.4);
  cursor: pointer;
  transform: translateY(0) scale(1);
  transition: transform 450ms var(--ease-out), border-color 350ms ease, box-shadow 350ms ease;
}
.rep-card:focus-visible {
  outline: none;
  border-color: rgba(255, 219, 22, 0.72);
  box-shadow: 0 34px 90px rgba(0, 4, 37, 0.65), 0 0 0 4px rgba(255, 219, 22, 0.35);
}

.rep-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(255, 219, 22, 0.65);
  box-shadow: 0 30px 70px rgba(0, 4, 37, 0.55), 0 0 0 4px rgba(255, 219, 22, 0.08);
}

.rep-card__img-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #00134f;
}
.rep-card__img-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.rep-card__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 38%, rgba(1, 21, 88, 0.62) 62%, #01134f 92%);
}

.rep-card__badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(2, 25, 98, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.rep-card__verified {
  display: inline-flex;
  width: 1.12em;
  height: 1.12em;
  margin-left: 6px;
  vertical-align: -0.16em;
  filter: drop-shadow(0 4px 8px rgba(0, 26, 113, 0.4));
}
.verified-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.verified-mark__icon {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

.rep-card__label {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 14px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 4, 32, 0.4);
}
.rep-card__label small {
  display: block;
  margin-bottom: 5px;
  color: var(--mira-yellow);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.rep-card__label strong {
  display: block;
  font-family: "Manrope", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.rep-card__label span {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.3;
}

.rep-card__socials {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 250ms ease, transform 250ms ease;
}
.rep-card:hover .rep-card__socials,
.rep-card:focus-within .rep-card__socials { opacity: 1; transform: translateX(0); }

.rep-card__socials a {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 0.7rem;
  backdrop-filter: blur(8px);
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}
.rep-card__socials a:hover {
  background: var(--mira-yellow);
  color: #052479;
  transform: scale(1.1);
}

.empty-state {
  text-align: center;
  margin: 60px auto;
  max-width: 42ch;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: clamp(40px, 5vw, 60px);
  flex-wrap: wrap;
}
.pagination button {
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}
.pagination button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); transform: translateY(-2px); }
.pagination button.is-active {
  background: var(--mira-yellow);
  color: #052479;
  border-color: var(--mira-yellow);
}
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }
.pagination span { color: rgba(255, 255, 255, 0.5); padding: 0 4px; }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.is-hidden { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 6, 32, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modal-fade 250ms ease both;
}

.modal__panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  width: min(760px, 100%);
  max-height: min(640px, 92vh);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(20, 34, 92, 0.96), rgba(0, 19, 79, 0.98));
  box-shadow: 0 40px 100px rgba(0, 4, 36, 0.55);
  animation: modal-in 320ms var(--ease-out) both;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__close {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 6, 32, 0.5);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 200ms ease, transform 200ms ease;
}
.modal__close:hover { background: var(--mira-yellow); color: #052479; transform: rotate(90deg); }

.modal__media {
  position: relative;
  min-height: 220px;
  background: linear-gradient(155deg, #022eda 0%, #00134f 88%);
}
.modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.modal__verified {
  position: static;
  display: inline-flex;
  width: 32px;
  height: 32px;
  margin-left: 8px;
  vertical-align: -0.38em;
  filter: drop-shadow(0 4px 8px rgba(0, 26, 113, 0.4));
}

.modal__body {
  padding: clamp(26px, 3vw, 40px);
  overflow-y: auto;
}

.modal__badge {
  display: inline-flex;
  padding: 5px 12px;
  margin-bottom: 16px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal__kicker {
  margin: 0 0 6px;
  color: var(--mira-yellow);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.modal__body h2 {
  margin: 0 0 16px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
body .mira-representatives-directory .modal__body h2,
body .mira-representatives-directory #modalName {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

body .mira-representatives-directory #modalName {
  display: inline;
  overflow-wrap: anywhere;
}

.modal__location {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
  line-height: 1.5;
}
.modal__location i { color: var(--mira-yellow); }

.modal__bio {
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.94rem;
  line-height: 1.68;
}

.modal__socials { display: flex; flex-wrap: wrap; gap: 10px; }
.modal__socials a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}
.modal__socials a:hover {
  background: var(--mira-yellow);
  color: #052479;
  transform: translateY(-2px);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .representatives-directory__layout {
    grid-template-columns: 1fr;
    grid-template-areas: "summary" "results" "filters";
    width: min(900px, calc(100% - 6vw));
  }
  .search-panel {
    position: relative;
    top: auto;
  }
  .search-form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .search-form__grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .modal__panel { grid-template-columns: 1fr; }
  .modal__media { min-height: 180px; }
}
