:root {
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: #14213d;
  background: #edf5ff;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 14%, rgba(45, 131, 255, 0.2), transparent 28rem),
    radial-gradient(circle at 88% 80%, rgba(0, 190, 171, 0.16), transparent 24rem),
    linear-gradient(135deg, #f7fbff 0%, #eaf4ff 55%, #f5ffff 100%);
}

button,
a {
  font: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(400px, 560px);
  align-items: center;
  justify-content: center;
  gap: clamp(48px, 8vw, 120px);
  min-height: 100vh;
  padding: 48px 28px 72px;
}

.intro {
  align-self: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  color: #1677ff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.intro h1 {
  margin: 0;
  font-size: clamp(48px, 7vw, 82px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.intro p {
  max-width: 440px;
  margin: 28px 0 0;
  color: #60708c;
  font-size: 18px;
  line-height: 1.8;
}

.login-card {
  width: 100%;
  min-height: 530px;
  padding: 38px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 28px 80px rgba(38, 91, 153, 0.15),
    inset 0 1px 0 #fff;
  backdrop-filter: blur(20px);
}

.view {
  display: flex;
  min-height: 450px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hidden {
  display: none !important;
}

.card-heading {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.card-heading h2,
#profile-view h2,
#error-view h2 {
  margin: 0;
  font-size: 24px;
}

.card-heading p {
  margin: 5px 0 0;
  color: #7a879c;
  font-size: 13px;
}

.ding-icon,
.error-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, #38a3ff, #1677ff);
  color: white;
  font-size: 21px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(22, 119, 255, 0.25);
}

.qr-container {
  width: 304px;
  height: 304px;
  margin: 20px auto 5px;
  overflow: hidden;
  border: 2px solid #e7f0fb;
  border-radius: 20px;
  background: #fff;
}

.qr-container iframe {
  border: 0;
}

.status-text {
  margin: 12px 0 18px;
  color: #60708c;
  font-size: 14px;
}

.secondary-button,
.primary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.secondary-button {
  padding: 0 18px;
  border: 1px solid #dce9f7;
  color: #32608f;
  background: #f7fbff;
  font-size: 13px;
}

.primary-button {
  width: 100%;
  padding: 0 24px;
  border: 0;
  color: white;
  background: linear-gradient(135deg, #2592ff, #1268e8);
  box-shadow: 0 12px 24px rgba(22, 119, 255, 0.22);
}

#admin-link {
  width: 100%;
  margin-bottom: 12px;
}

footer a {
  color: #4d6f99;
}

.secondary-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.avatar {
  width: 82px;
  height: 82px;
  margin: 0;
  border: 4px solid white;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 14px 32px rgba(38, 91, 153, 0.18);
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #38a3ff, #1677ff);
  color: white;
  font-size: 36px;
  font-weight: 800;
}

.success-label {
  margin: 0 0 6px;
  color: #18a572;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.profile-hero {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 20px;
  padding: 4px 2px 24px;
  text-align: left;
}

.profile-heading {
  min-width: 0;
}

.profile-heading h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-summary {
  margin: 7px 0 0;
  overflow: hidden;
  color: #6f7f97;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin: 0 0 20px;
  text-align: left;
}

.profile-detail {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #e6edf6;
  border-radius: 14px;
  background: #f7faff;
}

.profile-detail-highlight {
  border-color: #d7e9ff;
  background: linear-gradient(145deg, #f1f8ff, #f8fcff);
}

.profile-detail-wide {
  grid-column: 1 / -1;
}

.profile-details dt {
  margin-bottom: 5px;
  color: #8995a8;
  font-size: 12px;
}

.profile-details dd {
  margin: 0;
  color: #31425e;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.organization-notice {
  width: 100%;
  margin: 0 0 18px;
  padding: 11px 14px;
  border-radius: 12px;
  color: #8a6525;
  background: #fff7df;
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
}

.error-icon {
  margin-bottom: 24px;
  background: linear-gradient(145deg, #ff8f70, #ef4c4c);
  box-shadow: 0 10px 24px rgba(239, 76, 76, 0.24);
}

#error-message {
  margin: 14px 0 30px;
  color: #69768b;
  line-height: 1.7;
}

.spinner {
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border: 4px solid #dceaff;
  border-top-color: #1677ff;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

#loading-view p {
  color: #728099;
}

footer {
  position: fixed;
  bottom: 22px;
  left: 0;
  width: 100%;
  color: #8996aa;
  font-size: 12px;
  text-align: center;
}

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

@media (max-width: 880px) {
  .page-shell {
    grid-template-columns: minmax(0, 560px);
    gap: 36px;
    padding-top: 52px;
  }

  .intro {
    text-align: center;
  }

  .intro h1 {
    font-size: clamp(44px, 13vw, 68px);
  }

  .intro p {
    margin-right: auto;
    margin-left: auto;
  }

  footer {
    position: static;
    grid-column: 1;
  }
}

@media (max-width: 480px) {
  .page-shell {
    padding: 34px 14px;
  }

  .login-card {
    min-height: 500px;
    padding: 26px 18px;
    border-radius: 22px;
  }

  .qr-container {
    transform: scale(0.92);
    margin-top: 10px;
    margin-bottom: -8px;
  }

  .profile-details {
    grid-template-columns: 1fr;
  }

  .profile-detail-wide {
    grid-column: auto;
  }
}

body.embed {
  min-height: 0;
  background: #fff;
}

body.embed .page-shell {
  display: block;
  max-width: 360px;
  margin: 0 auto;
  padding: 12px 8px 16px;
}

body.embed .intro,
body.embed footer {
  display: none;
}

body.embed .login-card {
  min-height: 0;
  padding: 16px 12px 20px;
  border-radius: 12px;
  box-shadow: none;
}
