/**
 * @file map-account.css
 * @purpose Style the optional account icon, blurred modal, forms, and profile.
 * @dependencies map-account.js state classes and account markup in map.html.
 * @public Account dialog, form, status and profile classes.
 * @sideEffects Adds a full-map modal layer while the account board is open.
 */

.account-menu-button {
  position: relative;
  font: inherit;
}

.account-menu-button.is-authenticated::after {
  position: absolute;
  right: 0.34rem;
  bottom: 0.34rem;
  width: 0.42rem;
  height: 0.42rem;
  border: 2px solid rgb(19, 30, 26);
  border-radius: 50%;
  background: #4285F4;
  content: "";
}

.account-icon {
  position: relative;
  display: block;
  width: 1rem;
  height: 1rem;
  border: 1.55px solid currentColor;
  border-radius: 50%;
}

.account-icon::before {
  position: absolute;
  top: 0.18rem;
  left: 50%;
  width: 0.29rem;
  height: 0.29rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}

.account-icon::after {
  position: absolute;
  right: 0.18rem;
  bottom: 0.14rem;
  left: 0.18rem;
  height: 0.28rem;
  border-radius: 0.5rem 0.5rem 0.2rem 0.2rem;
  background: currentColor;
  content: "";
}

.account-overlay {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  padding: 1rem;
  overflow: auto;
  background: rgba(8, 15, 12, 0.46);
  place-items: center;
  backdrop-filter: blur(8px) saturate(0.82);
  -webkit-backdrop-filter: blur(8px) saturate(0.82);
}

.account-overlay[hidden],
.account-view[hidden],
.account-tabs[hidden],
.account-status[hidden] {
  display: none;
}

/* ----- Dialog and brighter account typography ----- */
.account-dialog {
  display: grid;
  width: min(25rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0.7rem;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.86rem;
  background: rgba(22, 31, 27, 0.97);
  box-shadow: 0 24px 70px rgba(4, 10, 8, 0.48);
  color: #fff;
  gap: 0.65rem;
}

.account-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.32rem 0.34rem 0.08rem;
}

.account-dialog-heading {
  display: grid;
  gap: 0.12rem;
}

.account-dialog-heading small {
  color: #4285F4;
  font-size: 0.572rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.account-dialog-heading h2 {
  margin: 0;
  font-size: 1.122rem;
  letter-spacing: -0.025em;
}

.account-close {
  display: grid;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 0;
  border-radius: 0.42rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font: inherit;
  font-size: 1.155rem;
  place-items: center;
}

.account-close:hover,
.account-close:focus-visible {
  outline: 0;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.account-intro {
  margin: 0;
  padding: 0 0.34rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.671rem;
  font-weight: 620;
  line-height: 1.5;
}

.account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.22rem;
  padding: 0.22rem;
  border-radius: 0.56rem;
  background: rgba(255, 255, 255, 0.055);
}

.account-tab {
  min-height: 2.2rem;
  padding: 0.4rem 0.7rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font: inherit;
  font-size: 0.671rem;
  font-weight: 800;
}

.account-tab:hover,
.account-tab:focus-visible,
.account-tab.is-active {
  outline: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ----- Forms, field hints and submission feedback ----- */
.account-view,
.account-form {
  display: grid;
  gap: 0.58rem;
}

.account-view {
  padding: 0.12rem;
}

.account-field {
  display: grid;
  gap: 0.24rem;
}

.account-field > span {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.605rem;
  font-weight: 760;
}

.account-field input {
  width: 100%;
  min-height: 2.45rem;
  padding: 0.52rem 0.64rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0.48rem;
  outline: 0;
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
  font: inherit;
  font-size: 0.726rem;
}

.account-field input::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.account-field input:focus {
  border-color: rgba(66, 133, 244, 0.62);
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.12);
}

.account-field-hint {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.55rem;
  line-height: 1.4;
}

.account-primary,
.account-secondary {
  min-height: 2.35rem;
  padding: 0.48rem 0.76rem;
  border-radius: 0.48rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 850;
}

.account-primary {
  border: 1px solid rgba(66, 133, 244, 0.34);
  background: #4285F4;
  color: #ffffff;
}

.account-secondary {
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
}

.account-primary:hover,
.account-primary:focus-visible {
  outline: 0;
  background: #4285F4;
}

.account-secondary:hover,
.account-secondary:focus-visible {
  outline: 0;
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.account-primary:disabled,
.account-secondary:disabled,
.account-form.is-busy input {
  cursor: wait;
  opacity: 0.58;
}

.account-status {
  margin: 0;
  padding: 0.5rem 0.62rem;
  border: 1px solid rgba(66, 133, 244, 0.24);
  border-radius: 0.46rem;
  background: rgba(66, 133, 244, 0.08);
  color: #4285F4;
  font-size: 0.605rem;
  font-weight: 720;
  line-height: 1.4;
}

.account-status.is-error {
  border-color: rgba(255, 105, 105, 0.28);
  background: rgba(209, 60, 60, 0.1);
  color: #ffb0b0;
}

.account-verification-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.649rem;
  line-height: 1.5;
}

.account-verification-copy strong {
  color: #fff;
}

.account-code-input {
  text-align: center;
  font-size: 1.1rem !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.28em;
}

.account-profile {
  display: grid;
  gap: 0.7rem;
  padding: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.56rem;
  background: rgba(255, 255, 255, 0.04);
}

.account-profile-identity {
  display: grid;
  gap: 0.14rem;
}

.account-profile-identity strong {
  font-size: 0.858rem;
}

.account-profile-identity span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.616rem;
}

body.has-account-dialog {
  overflow: hidden;
}

@media (max-width: 30rem) {
  .account-overlay {
    align-items: end;
    padding: 0.65rem;
  }

  .account-dialog {
    width: 100%;
    max-height: calc(100dvh - 1.3rem);
    border-radius: 0.78rem;
  }
}
