: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: center;
}

.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-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: 900px;
  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;
}

.web-signup-note {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(28, 129, 233, 0.08);
  border: 1px solid rgba(28, 129, 233, 0.14);
  text-align: center;
}

.web-signup-note p {
  margin: 0;
  color: var(--blue);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.5;
}

.app-store-badge-link {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.app-store-badge {
  height: 44px;
  width: auto;
  display: block;
}

.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: 860px) {
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .auth-intro {
    padding: 0;
    max-width: none;
    text-align: center;
  }

  .auth-logo-wrap {
    justify-content: center;
  }

  h1,
  .auth-subtitle {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .auth-card {
    justify-self: stretch;
    max-width: 640px;
    margin: 0 auto;
  }
}

@media (max-width: 540px) {
  .auth-shell {
    padding: 16px 14px 20px;
  }

  .auth-layout {
    gap: 14px;
  }

  .auth-intro {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 0;
  }

  .auth-logo-wrap {
    justify-content: center;
    margin-bottom: 10px;
    width: 100%;
  }

  .auth-logo {
    width: min(220px, 82vw);
  }

  .auth-mode-chip {
    margin-left: auto;
    margin-right: auto;
  }

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

  h1 {
    font-size: 1.9rem;
    letter-spacing: 0.05em;
    text-align: center;
    margin-bottom: 6px;
  }

  .auth-subtitle {
    font-size: 0.93rem;
    line-height: 1.5;
    text-align: center;
    margin: 0 auto 14px;
    max-width: 320px;
  }

  .auth-feature-row {
    display: none;
  }

  .auth-card {
    padding: 20px 16px 18px;
    border-radius: 20px;
    justify-self: stretch;
    max-width: none;
  }

  .auth-form {
    gap: 12px;
  }

  .field-wrap input {
    padding: 12px 13px;
    border-radius: 13px;
  }

  .primary-btn,
  .secondary-auth-btn {
    padding: 13px 16px;
    border-radius: 15px;
  }

  .text-switch-btn {
    padding-top: 8px;
  }

  .web-signup-note {
    margin-top: 14px;
    padding: 14px 14px;
  }

  .web-signup-note p {
    font-size: 0.92rem;
  }

  .app-store-badge {
    height: 40px;
  }

  .prominent-message {
    margin-top: 16px;
    padding: 14px 15px;
    border-radius: 16px;
    font-size: 0.94rem;
  }

  .auth-footer {
    margin-top: 14px;
    padding-top: 14px;
    font-size: 0.8rem;
  }
}

@media (max-width: 540px) and (max-height: 820px) {
  .auth-shell {
    padding-top: 12px;
    padding-bottom: 16px;
  }

  .auth-logo {
    width: min(190px, 70vw);
  }

  h1 {
    font-size: 1.72rem;
  }

  .auth-subtitle {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }

  .auth-card {
    padding: 18px 14px 16px;
  }

  .auth-form {
    gap: 10px;
  }

  .field-wrap {
    gap: 6px;
  }

  .field-wrap label {
    font-size: 0.88rem;
  }

  .field-wrap input {
    padding: 11px 12px;
  }

  .primary-btn,
  .secondary-auth-btn {
    padding: 12px 14px;
  }

  .text-switch-btn {
    font-size: 0.95rem;
  }

  .form-message {
    margin-top: 10px;
    font-size: 0.88rem;
  }

  .prominent-message {
    padding: 12px 13px;
    font-size: 0.9rem;
  }
}
