*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal-primary:  #1b7a7a;
  --teal-dark:     #0f5454;
  --teal-light:    #73c2c2;
  --golden-amber:  #f5a623;
  --golden-light:  #ffd166;
  --cream-bg:      #fff8f0;
  --navy-text:     #1a2332;
  --navy-light:    #4a5568;
  --text-subtle:   #6b7a8f;
  --surface:       #ffffff;
  --border-soft:   rgba(27,122,122,0.16);
  --font-display:  'Fredoka', system-ui, sans-serif;
  --font-body:     'Plus Jakarta Sans', system-ui, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--cream-bg);
  color: var(--navy-text);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.login-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Reverse: form left, image right */
.login-wrapper--reversed {
  flex-direction: row-reverse;
}

/* ── Image Panel (2/3) ── */
.image-panel {
  flex: 0 0 66.666%;
  position: relative;
  overflow: hidden;
  background: var(--teal-dark);
}

.image-panel__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
  animation: kenburns 7s ease-out forwards;
}

.image-panel__slide.active {
  opacity: 1;
}

@keyframes kenburns {
  from { transform: scale(1.0); }
  to   { transform: scale(1.07); }
}

.image-panel__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(8,42,42,0.82) 0%,
    rgba(15,84,84,0.70) 50%,
    rgba(8,42,42,0.55) 100%
  );
}

.image-panel__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 30%, rgba(245,166,35,0.18) 0%, transparent 40%),
    radial-gradient(circle at 75% 80%, rgba(115,194,194,0.12) 0%, transparent 40%);
}

.image-panel__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding: 3rem;
}

.image-panel__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 1rem;
}

.image-panel__eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--golden-light);
  flex-shrink: 0;
}

.image-panel__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 500;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.image-panel__title span {
  color: var(--golden-light);
}

.image-panel__subtitle {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  max-width: 34ch;
  margin-bottom: 2rem;
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  backdrop-filter: blur(4px);
}

.trust-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--golden-light);
  flex-shrink: 0;
}

/* ── Login Panel (1/3) ── */
.login-panel {
  flex: 0 0 33.333%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 2rem;
  background: var(--surface);
  overflow-y: auto;
}

.login-panel__inner {
  width: 100%;
  max-width: 360px;
}

/* Logo */
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.login-logo__img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  padding: 4px;
}

.login-logo__school {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--navy-text);
  line-height: 1.2;
}

.login-logo__portal {
  margin-top: 0.75em;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-primary);
}

/* Heading */
.login-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--navy-text);
  margin-bottom: 0.35rem;
  text-align: center;
}

.login-subheading {
  font-size: 0.875rem;
  color: var(--text-subtle);
  text-align: center;
  margin-bottom: 1.75rem;
}

/* Alert */
.alert {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.alert--error {
  background: #fff2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.alert--info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
}

.alert__icon {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 0.05rem;
}

/* Form */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-light);
  margin-bottom: 0.45rem;
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-soft);
  background: #fafafa;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--navy-text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
}

.form-control::placeholder {
  color: #9ca3af;
}

.form-control:focus {
  border-color: var(--teal-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(27,122,122,0.12);
}

/* Buttons */
.btn-login {
  width: 100%;
  padding: 0.875rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(150deg, var(--teal-primary) 0%, var(--teal-dark) 100%);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(27,122,122,0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 0.5rem;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(27,122,122,0.38);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(27,122,122,0.22);
}

.btn-forgot {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 1rem;
  padding: 0.6rem;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-primary);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.btn-forgot:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

.new-user-btn {
  display: inline-block;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: #0369a1;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* Divider */
.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

.login-divider span {
  font-size: 0.75rem;
  color: var(--text-subtle);
  white-space: nowrap;
}

/* Footer */
.login-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-subtle);
}

/* ── Mobile: hide image panel, full-screen form ── */
@media (max-width: 768px) {
  .login-wrapper,
  .login-wrapper--reversed {
    flex-direction: column;
  }

  .image-panel {
    display: none;
  }

  .login-panel {
    flex: none;
    width: 100%;
    min-height: 100vh;
    padding: 2.5rem 1.5rem;
  }
}

@media (max-width: 420px) {
  .login-panel {
    padding: 2rem 1.25rem;
  }
}
