/* Modern CSS reset */
/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
   scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Generic page styling */

:root {
  --min-width: clamp(20em, 32%, 70em);
}

body {
  font-family: 'Roboto', Arial, sans-serif;
}
.page-header {
  padding: 0.5em;
}
.hero-header {
  color: white;
  padding: 2em 6em;
  display: flex;
  align-items: center;
  justify-content: space-between; 
  background: linear-gradient(
            90deg,
            #001c4b 0%,
            #3c448f 20%,
            #58388d 40%,
            #742d8b 60%,
            #912288 80%,
            #b41f8f 100%
        );

  background-size: cover;
  background-position: center center;
  box-shadow: inset 0px 4px 5px rgb(0 0 0 / 15%);
}
@media (max-width: 767px) {
  .hero-header {
    font-size: 1.5em;
      padding: 1.5em 2em;
  }
}
.hero-header h1 {
  font-family: 'Roboto', system-ui, Arial, sans-serif;
  font-size: 3em;
  font-weight: 300;
}

.signout-button {
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}

.signout-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.signout-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .signout-button {
    font-size: 0.6em;
    padding: 0.2rem 0.4rem;
  }
}

.hidden {
  display: none !important;
}

.invisible {
  display: none !important;
}

/* Progress bar container */
.progress-bar {

    width: 33%;
    min-width: 120px;
    height: 10px;
    background-color: #e5e5e5;
    border-radius: 5px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: #28b763;
    border-radius: 5px;
}




/* Form controls */

form:not([style*="display: none"]) {
  flex: 1;
  margin-right: 1em;
  position: relative;
  min-width: var(--min-width);
}

form.dual-form {
  width: 45%;
  float: left;
  margin-right: 5%;
}
label[for="email"],
label[for="phone"],
label[for="address"] {
  background-color: #f4f4f4;
  border-radius: 3px;
  border: 1px solid #575755;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  font-size: 16px;
  line-height: 22px;
  padding: 8px;
  width: 100%;
}

label {
  color: #575755;
  display: block;
  width: 100%;
  font-size: 16px;
  margin: 10px auto 2px;
}
input[type="text"],
input[type="email"],
input[type="phone"],
select {
  background: #fff;
  border-radius: 6px;
  border: 1px solid #bbb;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  font-size: 14px;
  line-height: 18px;
  padding: 8px;
  width: 100%;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="phone"]:focus,
select:focus {
  outline: 0;
  color: #26478d;
  border: 1px solid #406eb3;
  box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%), 0 0 8px rgb(102 175 233 / 60%);
}

input.token-input {
  width: 280px;
  display: inline-block;
  margin-right: 1em;
}

button, .download-button {
  margin-top: 1em;
  font-size: 15px;
  line-height: 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 8px 20px;
  color: white;
  background-color: #d12e73;
  border-color: #c52870;
  cursor: pointer;
  display: inline-block;
}

.left-column button {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

#find-address-button,
#validate-address-button {
  width: 33%;
  background-color: #5e2665;
}

#search-again-button,
.search-again-button {
  width: 33% !important;
  display: block !important;
  background-color: #5e2665;
}

button:hover, .download-button:hover {
  background-color: #c52870;
}

.formatted-address {
  border-radius: 4px;
  line-height: 24px;
  margin: 0;
}

.address-form-panel {
  margin: 0;
  padding: 0;
  min-height: 0;
  position: relative;
}

.address-form-panel .promptset,
.address-form-panel .error-display {
  margin: 0;
}

.address-form-panel .formatted-address:not(.hidden) {
  margin: 1em 0;
}

.address-form-panel .loader:not(.hidden) {
  margin: 1em 0;
}

.formatted-address h3 {
  color: #00be8b;
  font-size: 2em;
  font-family: Arial, sans-serif;
  line-height: 1.1;
  margin: 0 auto 10px;
}
.ua-banner {
  background: #fcf8e3;
  border-bottom: 1px solid #ffb321;
  padding: 1em 0;
  text-align: center;
}

/* Secondary panel */

.metadata {
  flex: 0 0 calc(33.33% - 0.67em);
  padding: 0;
  min-width: var(--min-width);
  align-items: flex-start;
}

.metadata-header {
  font-size: 1.5em;
  font-weight: 500;
  color: #ffffff;
  background-color: #005629;
  padding: 0.3em 1em;
  margin: 0 0 0.3em 0;
  box-shadow: 0 2px 6px 0 rgb(25 38 63 / 10%);
  border: 2px solid #004520;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}

.validated-address-info {
  padding: 1em;
  background-color: #c6edD2;
  box-shadow: 0 2px 6px 0 rgb(25 38 63 / 10%);
  border: 2px solid #8ac9a6;
  border-radius: 6px;
}

.metadata .data-grid {
  display: grid;
  grid-template-columns: minmax(9em, max-content) 1fr;
  column-gap: 0.75em;
  margin: 1em 0;
}

.metadata [id="delivery-address-key"], .metadata [id="delivery-address-value"] {
  margin-top: 1em;
}

.metadata .download-button {
  background-color: #EDF4FA;
  border-color: rgba(0, 69, 144, 0.3);
  color: #426da9;
}

.metadata .download-button:hover {
  background-color: #DCEAF4;
}

.validation-result-panel {
  width: 100%;
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
}

.metadata {
  margin-bottom: 1em;
}

.left-column {
  display: flex;
  flex-direction: column;
  flex: 0 0 32%;
  max-width: 32%;
  order: 1;
}

.results-column {
  flex: 0 0 32%;
  max-width: 32%;
  order: 2;
  display: flex;
  flex-direction: column;
  gap: 1em;
  margin-top: 20px;
}

.validation-result-panel h2 {
  font-size: 1em;
  font-weight: 400;
  margin: 0 0 1em 0;
  padding: 8px 20px;
  color: white;
  background-color: #d12e73;
  border: 1px solid #c52870;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  position: relative;
}

.validation-result-panel h2.clickable-header {
  cursor: pointer;
  user-select: none;
}

.validation-result-panel h2.clickable-header:hover {
  background-color: #c52870;
}

.validation-result-panel h2.clickable-header:active {
  background-color: #a91f5a;
}

.validation-result-panel h2::after {
  content: "⟩";
  position: absolute;
  right: 20px;
  transition: transform 0.3s ease;
  transform: rotate(-90deg);
}

.validation-result-panel h2.collapsed::after {
  transform: rotate(90deg);
}

.validation-result-panel h2:hover {
  background-color: #c52870;
}

.validation-header-button {
  font-size: 1em;
  font-weight: 400;
  margin: 0 0 1em 0;
  padding: 8px 20px;
  color: white;
  background-color: #d12e73;
  border: 1px solid #c52870;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  position: relative;
  display: block;
  text-align: left;
}

.validation-header-button::after {
  content: "⟩";
  position: absolute;
  right: 20px;
  transition: transform 0.3s ease;
  transform: rotate(-90deg);
}

.validation-header-button.collapsed::after {
  transform: rotate(90deg);
}

.validation-header-button:hover {
  background-color: #c52870;
}

.validation-header-button.purple-button {
  background-color: #5e2665;
  border-color: #4a1e51;
}

.validation-header-button.purple-button:hover {
  background-color: #4a1e51;
}

.validation-content {
  display: block;
  margin-bottom: 0;
  padding-bottom: 1em;
}

#email-validation-content,
#phone-validation-content {
  padding-top: 0.35em;
}

.validation-content.hidden {
  display: none;
}

.other-search-types-link {
  display: block;
  margin: 1em 0;
  color: #1d4f91;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9em;
}

.other-search-types-link:hover {
  color: #0d3f71;
}

.filter-fields-link {
  display: block;
  margin: 1em 0;
  color: #1d4f91;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9em;
}

.filter-fields-link:hover {
  color: #0d3f71;
}

.validation-result-panel .content {
  background-color: white;
  padding: 1em;
  border-radius: 4px;
  box-shadow: 0 2px 6px 0 rgb(25 38 63 / 10%);
  border: 1px solid #e5e5e5;
}

.result-value-alert {
  color: #c52828;
  font-weight: 600;
}

.intro {
  margin: 1em 1em 0;
}

main {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 2%;
  margin: 1em;
}

.left-column .validation-panels {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.left-column .validation-panels:first-of-type {
  margin-top: 20px;
  margin-bottom: 0;
}

.left-column .validation-panels:last-of-type {
  margin-top: 1em;
  margin-bottom: 0;
}

main.inactive {
  opacity: .5;
  pointer-events: none;
}

.search-type-panel {
  margin-right: 0;
  margin-bottom: 1em;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  min-width: var(--min-width);
}

.search-type-panel .header {
  font-size: 14px;
  margin: 0;
}

.search-type-panel .search-type-selector {
  cursor: pointer;
  margin-top: 0;
  margin-bottom: 1px;
  padding: 1em;
  color: #333;
  background-color: #eaeaea;
}

.search-type-selector input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  vertical-align: middle;
  cursor: pointer;
  accent-color: #5e2665;
}

.search-type-selector:hover {
  background-color: #f6f6f6;
}

.search-type-selector.search-type-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.search-type-selector.search-type-disabled:hover {
  background-color: #eaeaea;
}

.search-type-selector.search-type-disabled input[type="radio"] {
  cursor: not-allowed;
}

.search-type-panel .search-type-selected {
  border-left: 3px solid #e63888;
  background-color: #fff1fa;
}

.promptset input::placeholder {
  font-style: italic;
}

.promptset[data-promptset-type="singleline"] button.loader-inline {
  display: inline-flex;
  align-items: center;
}

.promptset[data-promptset-type="singleline"] button.loader-inline:after {
  content: '';
  width: 20px;
  height: 20px;
  margin-left: 10px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #fff;
  animation: .6s linear infinite spin, .2s linear fade;
}

.map {
  width: 100%;
  aspect-ratio: 2 / 1;
  background-color: white;
  border: 2px solid white;
  border-radius: 6px;
}

.alert-danger{
  color: #bb0048;
  background-color: #f7e0e9;
  border-color: #f7e0e9;
}

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

@keyframes fade {
  0% {
    opacity: 0.1;
  }
  100% {
    opacity: 1;
  }
}

/* Media queries */

@media (max-width: 480px) {
  /* Reduce horizontal padding */
  .hero-header {
    padding: 1em;
  }
  .hero-header h1 {
    font-size: 1.5em;
  }

    input.token-input {
      width: calc(100% - 70px);
      margin-right: 0;
    }

    #find-address-button,
    #validate-address-button {
      width: 100%;
    }

    #search-again-button,
    .search-again-button {
      width: 100% !important;
    }
  }

label[for="address"],
label[for="email"],
label[for="phone"] {
  display: flex; 
  align-items: center;
  gap: 8px;
}
label[for="address"]::before,
label[for="email"]::before,
label[for="phone"]::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
label[for="address"]::before { 
  background-image: url('../images/address-icon.jpg');
}
label[for="email"]::before { 
  background-image: url('../images/email-icon.jpg');
}
label[for="phone"]::before { 
  background-image: url('../images/phone-icon.jpg');
}

  /* ─── Responsive: tablet (≤ 900px) ─── */
  @media (max-width: 900px) {
    .left-column {
      flex: 0 0 48%;
      max-width: 48%;
    }

    .results-column {
      flex: 0 0 48%;
      max-width: 48%;
    }
  }

  /* ─── Responsive: mobile (≤ 768px) ─── */
  @media (max-width: 768px) {
    :root {
      --min-width: 0;
    }

    main {
      flex-direction: column;
    }

    .left-column {
      flex: 0 0 100%;
      max-width: 100%;
    }

    .results-column {
      flex: 0 0 100%;
      max-width: 100%;
    }

    .hero-header {
      padding: 1.5em 2em;
    }

    form.dual-form {
      width: 100%;
      float: none;
      margin-right: 0;
    }

    #find-address-button,
    #validate-address-button {
      width: 50%;
    }

    #search-again-button,
    .search-again-button {
      width: 50% !important;
    }
  }