:root {
  --bg: #eef3f9;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --border: rgba(12, 68, 124, 0.14);
  --text: #172554;
  --muted: #64748b;
  --primary: #0C447C;
  --primary-dark: #0A3A6B;
  --accent: #0f766e;
  --success: #047857;
  --danger: #b91c1c;
  --shadow: 0 30px 80px rgba(12, 68, 124, 0.14);
  --radius: 30px;
  --radius-md: 20px;
  /* Replace this variable with a real image layer when the login hero photo is ready. */
  --login-hero-image: url("/phase2building.png");
  --login-hero-overlay: linear-gradient(160deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.48));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(12, 68, 124, 0.18), transparent 32%),
    radial-gradient(circle at right bottom, rgba(15, 118, 110, 0.14), transparent 30%),
    linear-gradient(135deg, #e8eff7 0%, #f8fafc 100%);
  color: var(--text);
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  padding: 26px;
  gap: 26px;
}

.visual-panel,
.auth-panel,
.dashboard-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.visual-panel {
  position: relative;
  min-height: calc(100vh - 52px);
  background: var(--login-hero-overlay), var(--login-hero-image);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  display: flex;
  align-items: flex-end;
}

.visual-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.22), transparent 18%),
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.1), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 38%);
}

.visual-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 42px;
  color: #fff;
}

.visual-kicker,
.section-kicker {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
}

.visual-kicker {
  color: rgba(255, 255, 255, 0.8);
}

.visual-panel h1,
.auth-topbar h2 {
  margin: 0;
  line-height: 1.05;
}

.visual-panel h1 {
  font-size: clamp(38px, 4.6vw, 64px);
}

.visual-copy {
  margin: 22px 0 0;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.85;
  font-size: 16px;
}

.photo-placeholder {
  margin-top: 28px;
  min-height: 240px;
  border-radius: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 12px,
      rgba(255, 255, 255, 0.03) 12px,
      rgba(255, 255, 255, 0.03) 24px
    );
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.photo-logo {
  width: min(320px, 78%);
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(15, 23, 42, 0.2));
}

.photo-note {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
  text-align: center;
}

.auth-panel,
.dashboard-card {
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.auth-shell,
.dashboard-shell {
  min-height: calc(100vh - 52px);
  padding: 0 34px 26px;
  display: flex;
  flex-direction: column;
}

.auth-schoolbar {
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-school-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.auth-school-text {
  display: grid;
  gap: 4px;
}

.auth-school-cn {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
}

.auth-school-en {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.15;
}

.auth-titlebar {
  margin-top: 52px;
  padding-top: 0;
  display: flex;
  justify-content: flex-start;
}

.auth-titlebar .auth-hero-text {
  justify-items: start;
  text-align: left;
  margin-top: 0;
  gap: 8px;
}

.auth-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
}

.auth-logo {
  width: 270px;
  height: 270px;
  object-fit: contain;
}

.auth-hero-text {
  display: grid;
  gap: 6px;
  justify-items: start;
  margin-top: -4px;
}

.auth-hero-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
}

.auth-hero-cycle {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-kicker {
  color: var(--primary);
}

.panel-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 18px;
  font-weight: 700;
}

.status-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(12, 68, 124, 0.1);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.role-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 12px 0 12px;
}

.role-tab,
.primary-btn,
.ghost-btn,
.text-btn {
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.role-tab,
.ghost-btn {
  padding: 13px 14px;
  background: #e8eff7;
  color: var(--text);
}

.role-tab.active {
  background: linear-gradient(135deg, var(--primary), #1D9E75);
  color: #fff;
  box-shadow: 0 16px 32px rgba(12, 68, 124, 0.18);
}

.role-tab:hover,
.primary-btn:hover,
.ghost-btn:hover,
.text-btn:hover {
  transform: translateY(-1px);
}

.stack-form {
  display: grid;
  gap: 15px;
}

.stack-form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.stack-form input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(12, 68, 124, 0.16);
  background: var(--panel-strong);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text);
}

.stack-form input:focus {
  outline: none;
  border-color: rgba(12, 68, 124, 0.4);
  box-shadow: 0 0 0 4px rgba(12, 68, 124, 0.1);
}

.primary-btn {
  margin-top: 4px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--primary), #1D9E75);
  color: #fff;
  box-shadow: 0 18px 32px rgba(12, 68, 124, 0.18);
}

.ghost-btn {
  border: 1px solid rgba(12, 68, 124, 0.16);
}

.text-btn {
  margin-top: 12px;
  padding: 0;
  background: transparent;
  color: var(--primary);
  text-align: left;
}

.notice-box,
.dashboard-message {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.04);
  color: var(--muted);
  line-height: 1.75;
  white-space: pre-wrap;
}

.notice-box.success {
  background: rgba(5, 150, 105, 0.12);
  color: var(--success);
}

.notice-box.error {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

#messageBox.notice-box {
  margin-top: 18px;
}

.form-panel {
  display: none;
}

.form-panel.active {
  display: block;
}

.panel-footer {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

#loginFooter.panel-footer {
  margin-top: 18px;
  padding-top: 14px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
}

#loginFooter .footer-hint {
  max-width: 420px;
}

#loginFooter .footer-actions {
  width: 100%;
  justify-content: flex-start;
}

.footer-hint {
  color: var(--muted);
  line-height: 1.7;
  max-width: 320px;
}

.footer-register-btn {
  align-self: flex-end;
}

.footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.panel-link {
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.panel-link:hover {
  text-decoration: underline;
}

.hidden {
  display: none;
}

.dashboard-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-tile {
  background: var(--panel-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid rgba(12, 68, 124, 0.1);
}

.tile-label {
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}

.tile-value {
  font-size: 22px;
  font-weight: 800;
}

.tile-small {
  font-size: 15px;
  line-height: 1.65;
}

@media (max-width: 1080px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .visual-panel,
  .auth-shell,
  .dashboard-shell {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .auth-layout {
    padding: 16px;
    gap: 16px;
  }

  .visual-content,
  .auth-shell,
  .dashboard-shell {
    padding: 0 22px 18px;
  }

  .auth-schoolbar {
    padding-top: 10px;
    gap: 10px;
  }

  .auth-school-logo {
    width: 46px;
    height: 46px;
  }

  .auth-school-cn {
    font-size: 16px;
  }

  .auth-school-en {
    font-size: 11px;
  }

  .auth-titlebar {
    margin-top: 30px;
    padding-top: 0;
  }

  .auth-topbar,
  .panel-footer,
  .role-tabs,
  .dashboard-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .panel-footer {
    justify-content: stretch;
  }

  #loginFooter.panel-footer {
    display: flex;
  }

  .footer-actions {
    display: grid;
  }

  .footer-register-btn {
    width: 100%;
  }

  .auth-logo {
    width: 200px;
    height: 200px;
  }

  .auth-hero-title {
    font-size: 28px;
  }

  .auth-hero-cycle {
    font-size: 14px;
  }
}
