:root {
  --purple: #b174e7;
  --blue: #1c81e9;
  --bg: #f5f7fb;
  --card: rgba(255, 255, 255, 0.94);
  --text: #1d2433;
  --muted: #667085;
  --border: #e5e7eb;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.10);
  --radius: 24px;
  --success: #167c3c;
  --danger: #c62828;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Poppins", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(177, 116, 231, 0.12), transparent 32%),
    radial-gradient(circle at bottom right, rgba(28, 129, 233, 0.14), transparent 34%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.auth-page {
  min-height: 100vh;
  position: relative;
}

.auth-bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.45;
  pointer-events: none;
}

.auth-bg-orb-1 {
  width: 240px;
  height: 240px;
  background: rgba(177, 116, 231, 0.35);
  top: 40px;
  left: -60px;
}

.auth-bg-orb-2 {
  width: 280px;
  height: 280px;
  background: rgba(28, 129, 233, 0.30);
  bottom: 20px;
  right: -80px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  position: relative;
  z-index: 1;
}

.auth-layout {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 28px;
  align-items: stretch;
}

.auth-intro {
  align-self: center;
  padding: 10px 8px;
  max-width: 620px;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  justify-self: end;
  background: var(--card);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 26px 24px;
}

.auth-card-inner {
  display: grid;
  gap: 0;
}

.auth-logo-wrap {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.auth-logo {
  width: min(300px, 100%);
  height: auto;
  display: block;
}

.auth-mode-chip {
  width: fit-content;
  margin: 0 0 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(177, 116, 231, 0.12), rgba(28, 129, 233, 0.12));
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 700;
}

.auth-mode-chip-hero {
  display: none;
}

h1 {
  margin: 0 0 8px;
  text-align: left;
  font-size: clamp(2.5rem, 4vw, 4.4rem);
  line-height: 1.1;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-subtitle {
  margin: 0 0 22px;
  text-align: left;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 520px;
}

.auth-subtitle-hero {
  font-size: 1.02rem;
  max-width: 560px;
}

.auth-constellation {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto auto;
  gap: 14px;
  margin: 28px 0 16px;
  min-height: 230px;
}

.auth-constellation::before {
  content: "";
  position: absolute;
  inset: 30px 10px 22px;
  border-radius: 34px;
  border: 1px solid rgba(28, 129, 233, 0.12);
  background:
    radial-gradient(circle at 15% 20%, rgba(177, 116, 231, 0.16), transparent 28%),
    radial-gradient(circle at 84% 76%, rgba(28, 129, 233, 0.18), transparent 30%),
    rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(12px);
}

.auth-orbit,
.auth-signal,
.auth-feature-bubble {
  position: relative;
  z-index: 1;
}

.auth-orbit {
  display: grid;
  gap: 6px;
  border-radius: 24px;
  padding: 18px 18px 16px;
  color: #fff;
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.10);
}

.auth-orbit-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
}

.auth-orbit-copy {
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: 220px;
}

.auth-orbit-primary {
  grid-column: 1 / span 7;
  grid-row: 1;
  background: linear-gradient(135deg, rgba(28, 129, 233, 0.96), rgba(177, 116, 231, 0.92));
}

.auth-orbit-secondary {
  grid-column: 6 / span 7;
  grid-row: 1;
  align-self: end;
  margin-top: 56px;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.92), rgba(28, 129, 233, 0.84));
}

.auth-orbit-tertiary {
  grid-column: 3 / span 6;
  grid-row: 2;
  margin-top: -8px;
  background: linear-gradient(135deg, rgba(177, 116, 231, 0.92), rgba(17, 24, 39, 0.94));
}

.auth-signal {
  position: absolute;
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(28, 129, 233, 0.10);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(10px);
}

.auth-signal-title {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 800;
}

.auth-signal-value {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
  font-weight: 600;
}

.auth-signal-top {
  top: 0;
  right: 18px;
}

.auth-signal-bottom {
  left: 20px;
  bottom: -8px;
}

.auth-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
}

.auth-feature-bubble {
  padding: 11px 15px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: #fff;
}

.auth-feature-bubble-schedule {
  background: linear-gradient(135deg, rgba(28, 129, 233, 0.92), rgba(28, 129, 233, 0.66));
}

.auth-feature-bubble-assignments {
  background: linear-gradient(135deg, rgba(177, 116, 231, 0.94), rgba(177, 116, 231, 0.66));
}

.auth-feature-bubble-tests {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.92), rgba(28, 129, 233, 0.74));
}

.auth-feature-bubble-calendar {
  background: linear-gradient(135deg, rgba(28, 129, 233, 0.82), rgba(177, 116, 231, 0.84));
}

.auth-feature-bubble-theme {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.86), rgba(177, 116, 231, 0.88));
}

.auth-form {
  display: grid;
  gap: 14px;
  transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease, margin 0.25s ease;
  opacity: 1;
  transform: translateY(0);
  max-height: 700px;
  overflow: hidden;
}

.auth-form-hidden {
  opacity: 0;
  transform: translateY(8px);
  max-height: 0;
  margin: 0;
  pointer-events: none;
}

.field-wrap {
  display: grid;
  gap: 7px;
}

.field-wrap label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.field-wrap input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.16s ease;
}

.field-wrap input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(28, 129, 233, 0.12);
}

.auth-primary-btn {
  margin-top: 6px;
}

.primary-btn,
.secondary-auth-btn,
.text-switch-btn {
  font: inherit;
}

.primary-btn {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(28, 129, 233, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(28, 129, 233, 0.22);
}

.primary-btn:active {
  transform: translateY(0);
}

.secondary-auth-btn {
  width: 100%;
  border: 1px solid rgba(28, 129, 233, 0.16);
  border-radius: 16px;
  padding: 13px 18px;
  background: rgba(28, 129, 233, 0.08);
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.secondary-auth-btn:hover {
  transform: translateY(-1px);
  background: rgba(28, 129, 233, 0.12);
  border-color: rgba(28, 129, 233, 0.24);
}

.secondary-auth-btn:active {
  transform: translateY(0);
}

.text-switch-btn {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  padding: 10px 12px 0;
  cursor: pointer;
}

.text-switch-btn:hover {
  text-decoration: underline;
}

.forgot-password-btn {
  margin-top: -2px;
  padding-top: 4px;
}

.form-message {
  min-height: 24px;
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.93rem;
  line-height: 1.5;
  transition: all 0.22s ease;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--danger);
}

.prominent-message {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(22, 124, 60, 0.10);
  border: 1px solid rgba(22, 124, 60, 0.16);
  color: var(--success);
  font-size: 1.02rem;
  font-weight: 700;
}

.auth-message-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.auth-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

.footer-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.hidden-block {
  display: none !important;
}

.field-error-shake {
  animation: fieldShake 0.34s ease;
}

@keyframes fieldShake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

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

  .auth-intro {
    padding: 0;
  }

  .auth-mode-chip-hero {
    display: inline-flex;
  }

  .auth-card {
    padding: 24px 18px 20px;
    border-radius: 20px;
    justify-self: stretch;
  }

  h1 {
    font-size: 2rem;
    letter-spacing: 0.05em;
  }

  .auth-subtitle {
    font-size: 0.94rem;
  }

  .auth-constellation {
    min-height: 210px;
    margin-top: 18px;
  }

  .auth-orbit-primary,
  .auth-orbit-secondary,
  .auth-orbit-tertiary {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .auth-signal {
    position: static;
    min-width: 0;
  }

  .auth-feature-row {
    margin-top: 16px;
  }
}
