/* ── Fonts ──────────────────────────────────────────────────────────
   Plus Jakarta Sans  →  body, labels, inputs, buttons, all UI text
   Fraunces           →  brand title, school name, headings
──────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;0,9..144,700;1,9..144,600&display=swap');

:root {
  --background: #ffffff;
  --foreground: #1a1a1a;
  --card: #ffffff;
  --card-foreground: #1a1a1a;
  --primary: #102C26;
  --primary-foreground: #ffffff;
  --secondary: #102C26;
  --secondary-foreground: #102C26;
  --muted: #ececf0;
  --muted-foreground: #717182;
  --accent: #e9ebef;
  --accent-foreground: #102C26;
  --border: rgba(50, 65, 140, .1);
  --input-background: #f3f3f5;
  --radius: 0.625rem;
  --shadow: 0 1px 3px rgba(0, 0, 0, .1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, .25);
  --nu-gold: #FBD117;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  margin: 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.5;
  background: linear-gradient(135deg, var(--primary) 0%, #102C26 50%, #408A71 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Back to landing ─────────────────────────────────────────────── */
.back-to-landing {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .8rem;
  background: rgba(255, 255, 255, .15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 500;
  transition: all .3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  white-space: nowrap;
}

.back-to-landing:hover {
  background: rgba(255, 255, 255, .25);
  transform: translateY(-2px);
  color: #fff;
  text-decoration: none;
}

.back-to-landing i {
  font-size: .9rem;
}

/* ── Page wrapper ────────────────────────────────────────────────── */
.page-wrapper {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 860px;
  min-height: 540px;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin: 1rem;
  opacity: 1;
  transform: translateY(0);
}

/* ── Left panel ──────────────────────────────────────────────────── */
.left-panel {
  flex: 1;
  background: linear-gradient(160deg, rgba(255, 255, 255, .13) 0%, rgba(255, 255, 255, .05) 100%);
  backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255, 255, 255, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  background-color: #1a3f37 !important;
}

/* Animated shine overlay */
.left-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 200%;
  height: 200%;
  background: linear-gradient(115deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, .06) 40%,
      rgba(255, 255, 240, .1) 50%,
      rgba(255, 255, 255, 0) 60%);
  transform: rotate(25deg);
  pointer-events: none;
  animation: shineMove 12s infinite linear;
}

@keyframes shineMove {
  0% {
    transform: translateX(-100%) rotate(25deg);
  }

  25% {
    transform: translateX(20%) rotate(25deg);
  }

  50% {
    transform: translateX(80%) rotate(25deg);
  }

  100% {
    transform: translateX(180%) rotate(25deg);
  }
}

.school-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #fff;
  position: relative;
  z-index: 1;
}

.school-logo-wrap {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: none;
  transition: transform .3s ease;
}

.school-logo-wrap:hover {
  transform: scale(1.05);
}

.school-logo {
  width: 180px;
  height: 180px;
  object-fit: contain;
}

/* Fraunces for the school name */
.school-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--nu-gold);
  margin: 0 0 .4rem;
  line-height: 1.4;
  letter-spacing: .01em;
}

.school-tagline {
  font-family: var(--font-sans);
  font-size: .8rem;
  color: rgba(255, 255, 255, .65);
  margin: 0;
  font-style: italic;
}

/* ── Right panel ─────────────────────────────────────────────────── */
.right-panel {
  flex: 1.15;
  background: #dde2e8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2.25rem;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: #dde2e8;
  border-radius: 38px;
  box-shadow: 12px 12px 24px #a4afc2, -12px -12px 24px #ffffff;
  padding: 2rem 1.8rem;
  transition: all .2s ease;
}

/* ── Card header ─────────────────────────────────────────────────── */
.login-card-header {
  margin-bottom: 1.75rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .5rem;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Fraunces for the LEARNOVA++ brand title */
.brand-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.brand-subtitle {
  font-family: var(--font-sans);
  font-size: .75rem;
  color: var(--primary);
  margin: 0;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.brand-description {
  font-family: var(--font-sans);
  color: var(--muted-foreground);
  font-size: .875rem;
  margin: 0;
  text-align: left;
}

/* ── Form elements ───────────────────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.form-label {
  font-family: var(--font-sans);
  color: #2c3e3b;
  font-size: .8rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: .3px;
  display: block;
  margin-bottom: 8px;
}

.input-group {
  position: relative;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #6f7c91;
  font-size: 1.2rem;
  pointer-events: none;
  transition: all .2s;
  z-index: 2;
}

.form-input {
  font-family: var(--font-sans);
  width: 100%;
  padding: 14px 18px 14px 46px;
  border: none;
  outline: none;
  border-radius: 44px;
  background: #dde2e8;
  box-shadow: inset 9px 9px 18px #a4afc2, inset -9px -9px 18px #ffffff;
  font-size: 15px;
  font-weight: 500;
  color: #1e2a32;
  transition: all .2s ease;
}

.form-input:focus {
  box-shadow: inset 6px 6px 12px #a4afc2, inset -6px -6px 12px #ffffff;
  background: #e4e9f0;
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: #6f7c91;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 50%;
  transition: all .2s;
  z-index: 2;
}

.password-toggle:hover {
  color: #2c3e3b;
}

.password-toggle:active {
  transform: translateY(-50%) scale(.92);
}

/* OTP input */
input#otp {
  letter-spacing: 2px;
  font-family: monospace;
  text-align: center;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .875rem 1.5rem;
  font-size: .875rem;
  font-weight: 700;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  letter-spacing: .01em;
}

.btn-primary {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 700;
  color: #2c3e3b;
  border-radius: 44px;
  background: #79AE6F;
  box-shadow: 9px 9px 18px #a4afc2, -9px -9px 18px #ffffff;
  transition: all .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--nu-gold);
  transform: translateY(-1px);
}

.btn-primary:active {
  box-shadow: inset 7px 7px 14px #a4afc2, inset -7px -7px 14px #ffffff;
  transform: scale(.98);
}

.btn-outline-secondary {
  font-family: var(--font-sans);
  width: 100%;
  padding: 12px 20px;
  font-size: .95rem;
  font-weight: 600;
  color: #4c5563;
  border-radius: 44px;
  background: #dde2e8;
  box-shadow: 6px 6px 12px #a4afc2, -6px -6px 12px #ffffff;
  transition: all .2s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-outline-secondary:active {
  box-shadow: inset 5px 5px 10px #a4afc2, inset -5px -5px 10px #ffffff;
}

/* Loading state */
.btn-loading {
  opacity: .7;
  pointer-events: none;
  transform: scale(.98);
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert {
  font-family: var(--font-sans);
  border-radius: 40px;
  padding: 12px 18px;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
}

.alert-success {
  background: #d9e6da;
  color: #2c6e2f;
  box-shadow: inset 2px 2px 5px #c0d4be, inset -2px -2px 5px #f2fff0;
}

.alert-danger {
  background: #f5e0df;
  color: #b13e3e;
  box-shadow: inset 2px 2px 5px #d4b8b6, inset -2px -2px 5px #fff0ef;
}

.alert-warning {
  background: #fef9e3;
  color: #856404;
  box-shadow: inset 2px 2px 5px #e8d98f, inset -2px -2px 5px #fffef5;
}

/* ── Forgot password link ────────────────────────────────────────── */
.text-center a {
  font-family: var(--font-sans);
  color: #2c5c4a;
  text-decoration: none;
  font-weight: 600;
  background: #dde2e8;
  padding: 6px 18px;
  border-radius: 40px;
  box-shadow: 3px 3px 8px #a4afc2, -3px -3px 8px #ffffff;
  transition: all .2s ease;
  display: inline-block;
}

.text-center a:hover {
  color: #2c5c4a;
  background: var(--nu-gold);
  box-shadow: 3px 3px 8px #a4afc2, -3px -3px 8px #ffffff;
  transform: translateY(-1px);
}

.text-center a:active {
  box-shadow: inset 3px 3px 6px #a4afc2, inset -3px -3px 6px #ffffff;
  transform: scale(.98);
}

/* Highlighted forgot link on 3rd+ failed attempt */
.text-center.highlight-forgot a {
  background: var(--nu-gold);
  color: #1a3f37;
  box-shadow: 0 0 0 3px rgba(251, 209, 23, .5), 3px 3px 8px #a4afc2, -3px -3px 8px #ffffff;
  animation: pulseForgot 1.5s ease-in-out infinite;
}

@keyframes pulseForgot {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(251, 209, 23, .5), 3px 3px 8px #a4afc2;
  }

  50% {
    box-shadow: 0 0 0 7px rgba(251, 209, 23, .25), 3px 3px 8px #a4afc2;
  }
}

/* ── Secondary action buttons (forgot password page) ─────────────── */
.forgot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.forgot-actions form {
  margin: 0;
  display: block;
}

.forgot-btn-resend,
.forgot-btn-startover {
  font-family: var(--font-sans);
  width: 100%;
  min-height: 2.75rem;
  padding: .6rem .75rem;
  font-size: .8125rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  text-decoration: none;
  line-height: 1.2;
}

.forgot-btn-resend {
  background: var(--muted);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.forgot-btn-resend:hover {
  background: var(--accent);
  border-color: rgba(16, 44, 38, .2);
}

.forgot-btn-startover {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.forgot-btn-startover:hover {
  background: #fef2f2;
  border-color: #f87171;
}

.forgot-btn-resend i,
.forgot-btn-startover i {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body {
    padding: .5rem;
    align-items: flex-start;
    padding-top: 4rem;
  }

  .back-to-landing {
    top: .5rem;
    left: .5rem;
    padding: .5rem .7rem;
    font-size: .75rem;
    background: rgba(16, 44, 38, .9);
  }

  .page-wrapper {
    flex-direction: column;
    max-width: 420px;
    min-height: unset;
    border-radius: 1rem;
    margin: .5rem;
  }

  .left-panel {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, .15);
    padding: 2rem 1.5rem;
  }

  .school-logo-wrap {
    width: 110px;
    height: 110px;
  }

  .school-logo {
    width: 110px;
    height: 110px;
  }

  .right-panel {
    padding: 2rem 1.5rem;
  }

  .form-input {
    font-size: 16px;
  }

  .forgot-actions {
    grid-template-columns: 1fr;
  }
}