:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef3f8;
  color: #0f172a;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(34, 197, 94, 0.12), transparent 32%),
    #eef3f8;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.login-shell[hidden],
.app-header[hidden],
.app-footer[hidden],
.success-page[hidden],
.user-menu[hidden] {
  display: none;
}

.login-panel {
  width: min(560px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(18px);
}

.login-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand-mark.compact {
  width: 36px;
  height: 36px;
  border-radius: 7px;
}

.brand-mark svg,
.mode-tab svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.eyebrow {
  margin: 0 0 4px;
  color: #0369a1;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-subtitle {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 720;
  letter-spacing: 0.01em;
}

h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: 0;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #f8fafc;
}

.mode-tab {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-size: 14px;
  font-weight: 750;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.tab-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.tab-copy small {
  color: currentColor;
  font-size: 11px;
  font-weight: 720;
  opacity: 0.72;
}

.mode-tab:hover {
  color: #0f172a;
  background: #ffffff;
}

.mode-tab.active {
  border-color: #0f172a;
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

.login-mode-panel {
  min-height: 178px;
}

.mode-note {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

label {
  display: block;
  margin: 14px 0 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 760;
}

input {
  width: 100%;
  height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 0 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 15px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

input::placeholder {
  color: #94a3b8;
}

input:focus {
  border-color: #15803d;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.phone-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 8px;
  align-items: end;
}

.primary-button,
.secondary-button {
  position: relative;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 780;
  transition: background-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 20px;
  background: #0f172a;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
}

.primary-button:hover:not(:disabled) {
  background: #1e293b;
}

.secondary-button {
  background: #15803d;
}

.secondary-button:hover:not(:disabled) {
  background: #166534;
}

.button-loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

button.loading .button-label {
  display: none;
}

button.loading .button-loader {
  display: block;
}

.app-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #0f172a;
  text-decoration: none;
}

.app-brand strong {
  display: block;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.15;
}

.app-brand small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 720;
}

.user-menu {
  min-width: 280px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

.user-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 14px;
  font-weight: 850;
}

.user-menu-copy {
  min-width: 0;
}

.user-menu-copy strong,
.user-menu-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-copy strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 830;
}

.user-menu-copy small {
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 680;
}

.logout-button {
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 0 12px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 780;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.logout-button:hover:not(:disabled),
.logout-button:focus-visible {
  border-color: #0f172a;
  background: #0f172a;
  color: #ffffff;
  outline: none;
}

.success-panel {
  min-height: 420px;
  display: grid;
  align-content: start;
  justify-items: stretch;
  text-align: left;
}

.success-panel[hidden],
.success-page[hidden] {
  display: none;
}

.success-page {
  min-height: calc(100vh - 136px);
  display: grid;
  align-content: start;
  gap: 28px;
  padding: clamp(28px, 5vw, 72px);
}

.success-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 28px;
  align-items: end;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.32);
}

.success-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 8px;
  background: #dcfce7;
  color: #15803d;
}

.success-mark svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 0.98;
  font-weight: 880;
  letter-spacing: 0;
}

.success-page p {
  max-width: 760px;
  margin: 18px 0 0;
  color: #475569;
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.65;
}

.signed-user-card {
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: rgba(240, 249, 255, 0.82);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

.signed-user-label {
  color: #0369a1;
  font-size: 12px;
  font-weight: 850;
}

.signed-user-card strong {
  color: #0f172a;
  font-size: 22px;
  font-weight: 860;
}

.signed-user-card span:last-child {
  color: #475569;
  font-size: 13px;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.destination-section {
  display: grid;
  gap: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h3 {
  margin: 0;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 860;
}

.section-heading p {
  max-width: 420px;
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}

.destination-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.destination-card {
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 168px;
  padding: 20px;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.destination-card:hover,
.destination-card:focus-visible {
  border-color: #0369a1;
  box-shadow: 0 12px 28px rgba(3, 105, 161, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.destination-card.muted {
  background: #f8fafc;
  color: #64748b;
}

.destination-card.admin-only {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.destination-kicker {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 850;
}

.destination-card.muted .destination-kicker {
  background: #e2e8f0;
  color: #64748b;
}

.destination-card.admin-only .destination-kicker {
  background: #dcfce7;
  color: #15803d;
}

.destination-title {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 850;
}

.destination-host {
  color: #64748b;
  font-size: 13px;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.message {
  min-height: 20px;
  margin-top: 12px;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.message.success {
  color: #047857;
}

.not-found-panel {
  display: grid;
  align-content: start;
}

.not-found-status {
  width: fit-content;
  margin: 2px 0 14px;
  padding: 6px 10px;
  border: 1px solid #bae6fd;
  border-radius: 7px;
  background: #f0f9ff;
  color: #0369a1;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.not-found-copy {
  margin: 10px 0 20px;
  color: #475569;
  font-size: 14px;
  line-height: 1.7;
}

.not-found-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.primary-link-button,
.secondary-link-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 820;
  text-align: center;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.primary-link-button {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
}

.primary-link-button:hover,
.primary-link-button:focus-visible {
  background: #1e293b;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.2);
  transform: translateY(-1px);
  outline: none;
}

.secondary-link-button {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
}

.secondary-link-button:hover,
.secondary-link-button:focus-visible {
  border-color: #0369a1;
  box-shadow: 0 12px 28px rgba(3, 105, 161, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.not-found-destinations {
  padding-top: 2px;
}

.app-footer {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(20px, 5vw, 72px);
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  color: #64748b;
  font-size: 12px;
  font-weight: 720;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 440px) {
  .login-panel {
    padding: 22px;
  }

  .login-header {
    align-items: flex-start;
  }

  .phone-row {
    grid-template-columns: 1fr;
  }

  .not-found-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-menu {
    width: 100%;
  }

  .success-hero,
  .destination-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .section-heading p {
    text-align: left;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-top: 14px;
    padding-bottom: 14px;
  }
}
