.mobile-nav {
  position: fixed;
  z-index: 25;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 66px;
  padding: 6px;
  border: 1px solid rgba(230, 224, 235, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 38px rgba(41, 31, 54, 0.14);
  backdrop-filter: blur(16px);
}

.mobile-nav button {
  display: grid;
  gap: 2px;
  padding: 6px 2px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.59rem;
}

.mobile-nav button > span {
  font-size: 1rem;
}

.mobile-nav button.active {
  background: var(--purple-soft);
  color: var(--purple);
  font-weight: 850;
}

.mobile-fab {
  position: fixed;
  z-index: 26;
  right: 18px;
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 78px);
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 17px;
  background: var(--purple);
  color: #ffffff;
  font-size: 1.55rem;
  box-shadow: 0 12px 28px rgba(115, 86, 237, 0.35);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: max(28px, calc(env(safe-area-inset-top) + 8px)) 0 0;
  background: rgba(32, 24, 42, 0.45);
  backdrop-filter: blur(5px);
}

.modal-backdrop.open {
  display: flex;
}

.modal-sheet,
.detail-sheet {
  width: min(560px, 100%);
  max-height: calc(100vh - max(28px, calc(env(safe-area-inset-top) + 8px)));
  max-height: calc(100dvh - max(28px, calc(env(safe-area-inset-top) + 8px)));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(30, 19, 48, 0.3);
  transform: translateY(var(--sheet-drag-y, 0));
  transition: transform 180ms ease;
  touch-action: pan-y;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: -8px auto 16px;
  border-radius: 5px;
  background: var(--border);
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.type-button {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 12px 4px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
  font-size: 0.68rem;
}

.type-button span {
  font-size: 1.1rem;
}

.type-button.selected {
  border-color: var(--purple);
  background: var(--purple-soft);
  color: var(--purple);
  font-weight: 800;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.detail-heading {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 38px;
  gap: 12px;
  align-items: center;
}

.detail-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7c09b, #e77983);
  font-size: 1.3rem;
}

.detail-list {
  margin: 18px 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}

.detail-list dd {
  font-weight: 700;
}

.document-heading {
  margin-top: 18px;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 16px;
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 82px);
  left: 16px;
  display: none;
  max-width: 440px;
  margin-left: auto;
  padding: 13px 15px;
  border-radius: 13px;
  background: #302a38;
  color: #ffffff;
  font-size: 0.76rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.toast.show {
  display: block;
  animation: view-in 160ms ease;
}

.login-body {
  background: var(--surface);
}

.login-main {
  min-height: 100vh;
}

.login-art {
  position: relative;
  display: flex;
  min-height: 300px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 28px 24px;
  background: linear-gradient(145deg, #6754ed, #a661dd 55%, #eb7183);
  color: #ffffff;
}

.login-art::before,
.login-art::after {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  content: "";
}

.login-art::before {
  top: -110px;
  right: -120px;
  width: 310px;
  height: 310px;
}

.login-art::after {
  bottom: -100px;
  left: -100px;
  width: 230px;
  height: 230px;
}

.login-art .brand,
.login-promise {
  position: relative;
  z-index: 1;
  color: #ffffff;
}

.login-art .brand img {
  width: 43px;
  height: 43px;
  border-radius: 13px;
}

.login-promise h1 {
  max-width: 440px;
  font-size: clamp(2rem, 8vw, 3.2rem);
  letter-spacing: -0.055em;
}

.login-promise p {
  max-width: 470px;
  margin-top: 13px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

.login-form-wrap {
  display: flex;
  padding: 34px 24px;
  justify-content: center;
}

.login-panel {
  width: min(440px, 100%);
}

.login-panel h2 {
  font-size: 1.75rem;
}

.login-panel .lead {
  margin: 7px 0 22px;
}

.login-panel .primary-button {
  width: 100%;
  margin-top: 5px;
}

.error {
  min-height: 1.4em;
  margin: 14px 0 0;
  color: #a23f4f;
  font-size: 0.8rem;
}
