/* IndigiTrail Authentication UI — scoped and independent from legacy page CSS */
:root {
  --it-forest: #163e2c;
  --it-forest-2: #205b3b;
  --it-forest-3: #2d6a43;
  --it-brown: #7a4c2b;
  --it-cream: #f8f3e9;
  --it-card: rgba(255, 253, 248, 0.96);
  --it-line: #ddd2c1;
  --it-text: #27362d;
  --it-muted: #6d736e;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.it-auth-page {
  min-height: 100svh;
  background: #f6f0e6;
  color: var(--it-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.it-auth-page .it-auth-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 52%) minmax(460px, 48%);
  background: var(--it-cream);
}

/* LEFT PANEL */
body.it-auth-page .it-auth-visual {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: start center;
  padding: clamp(44px, 6vw, 92px) clamp(34px, 5vw, 78px);
  background: url("../assets/images/login-auth-bg.png") center 58% / cover no-repeat;
  isolation: isolate;
}
body.it-auth-page .it-auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(251,246,236,.91) 0%, rgba(251,246,236,.78) 20%, rgba(251,246,236,.38) 42%, rgba(24,46,31,.05) 68%, rgba(18,38,25,.20) 100%),
    linear-gradient(90deg, rgba(250,245,235,.24), transparent 42%);
  z-index: -1;
}
body.it-auth-page .it-auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset -1px 0 rgba(60,45,30,.08);
  pointer-events: none;
}
body.it-auth-page .it-auth-visual-overlay { display: none; }

body.it-auth-page .it-auth-brand {
  width: min(100%, 560px);
  text-align: center;
  padding-top: clamp(8px, 2vh, 26px);
  animation: itAuthRise .65s cubic-bezier(.2,.75,.25,1) both;
}
body.it-auth-page .it-auth-logo {
  display: block;
  width: clamp(126px, 10vw, 166px);
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0 auto 18px;
  filter: drop-shadow(0 12px 24px rgba(45,34,20,.12));
}
body.it-auth-page .it-auth-brand-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 5vw, 74px);
  line-height: .98;
  letter-spacing: -2px;
  font-weight: 700;
  color: #6f3f23;
  text-shadow: 0 2px 0 rgba(255,255,255,.25);
}
body.it-auth-page .it-auth-brand-name span { color: #123f2b; }
body.it-auth-page .it-auth-ornament,
body.it-auth-page .it-auth-footer-ornament {
  width: 260px;
  max-width: 68%;
  height: 22px;
  margin: 20px auto 14px;
  position: relative;
}
body.it-auth-page .it-auth-ornament::before,
body.it-auth-page .it-auth-ornament::after,
body.it-auth-page .it-auth-footer-ornament::before,
body.it-auth-page .it-auth-footer-ornament::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 18px);
  height: 1px;
  background: rgba(119,82,47,.72);
}
body.it-auth-page .it-auth-ornament::before,
body.it-auth-page .it-auth-footer-ornament::before { left: 0; }
body.it-auth-page .it-auth-ornament::after,
body.it-auth-page .it-auth-footer-ornament::after { right: 0; }
body.it-auth-page .it-auth-ornament span,
body.it-auth-page .it-auth-footer-ornament span {
  position: absolute;
  width: 10px;
  height: 10px;
  left: 50%;
  top: 50%;
  border: 1.5px solid #8a5a35;
  transform: translate(-50%,-50%) rotate(45deg);
}
body.it-auth-page .it-auth-project-title {
  max-width: 520px;
  margin: 0 auto;
  color: #1f392c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 1.75vw, 28px);
  line-height: 1.42;
  text-wrap: balance;
}

/* RIGHT PANEL */
body.it-auth-page .it-auth-form-panel {
  position: relative;
  min-height: 100svh;
  padding: clamp(38px, 5vw, 82px) clamp(30px, 5vw, 82px);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 96% 92%, rgba(114,137,93,.09), transparent 24%),
    linear-gradient(180deg, #faf6ee 0%, #f8f3e9 100%);
  overflow: hidden;
}
body.it-auth-page .it-auth-form-panel::before {
  content: "";
  position: absolute;
  right: -58px;
  top: -46px;
  width: 250px;
  height: 250px;
  opacity: .08;
  background:
    repeating-linear-gradient(45deg, #7f653f 0 3px, transparent 3px 16px),
    repeating-linear-gradient(-45deg, #7f653f 0 3px, transparent 3px 16px);
  transform: rotate(8deg);
  pointer-events: none;
}
body.it-auth-page .it-auth-form-panel::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -55px;
  width: 260px;
  height: 260px;
  border-radius: 48% 52% 56% 44%;
  opacity: .075;
  background:
    radial-gradient(ellipse at 35% 25%, #4d704f 0 9%, transparent 10%),
    radial-gradient(ellipse at 50% 50%, #4d704f 0 9%, transparent 10%),
    radial-gradient(ellipse at 70% 70%, #4d704f 0 9%, transparent 10%);
  pointer-events: none;
}

body.it-auth-page .it-auth-form-card {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  padding: clamp(34px, 4vw, 56px);
  border-radius: 28px;
  background: var(--it-card);
  border: 1px solid rgba(111,80,48,.10);
  box-shadow: 0 30px 64px rgba(68,48,28,.10), 0 4px 14px rgba(68,48,28,.045);
  animation: itAuthRise .65s .08s cubic-bezier(.2,.75,.25,1) both;
}
body.it-auth-page .it-auth-form-card h2 {
  margin: 0 0 34px;
  color: #123b29;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 4vw, 58px);
  line-height: 1.05;
  letter-spacing: -1.4px;
  font-weight: 700;
}
body.it-auth-page .it-auth-intro {
  margin: -20px 0 24px;
  color: var(--it-muted);
  line-height: 1.55;
  font-size: 14px;
}
body.it-auth-page form { margin: 0; }
body.it-auth-page .it-auth-field-group { margin-bottom: 22px; }
body.it-auth-page .it-auth-field-group label {
  display: block;
  margin: 0 0 9px;
  font-family: Georgia, "Times New Roman", serif;
  color: #2e372f;
  font-size: 17px;
  font-weight: 700;
}
body.it-auth-page .it-auth-input-wrap {
  position: relative;
}
body.it-auth-page .it-auth-input-wrap input {
  width: 100%;
  height: 60px;
  margin: 0;
  padding: 0 52px;
  border: 1px solid #d7d2c9;
  border-radius: 13px;
  background: rgba(255,255,255,.86);
  color: #26342b;
  font: inherit;
  font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}
body.it-auth-page .it-auth-input-wrap input::placeholder { color: #979b98; }
body.it-auth-page .it-auth-input-wrap input:focus {
  border-color: #316c49;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(44,105,69,.10), 0 9px 24px rgba(44,105,69,.08);
  transform: translateY(-1px);
}
body.it-auth-page .it-auth-input-icon {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: #7c8580;
  pointer-events: none;
}
body.it-auth-page .it-auth-input-icon svg { width: 100%; height: 100%; display: block; }
body.it-auth-page .it-auth-password-toggle {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #25643f;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
body.it-auth-page .it-auth-password-toggle:hover { background: rgba(34,99,61,.08); color: #173f29; }
body.it-auth-page .it-auth-link-row {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 24px;
}
body.it-auth-page a {
  color: #8a4b27;
  text-decoration: none;
  font-weight: 700;
}
body.it-auth-page a:hover { text-decoration: underline; text-underline-offset: 3px; }

body.it-auth-page .it-auth-primary,
body.it-auth-page .it-auth-google {
  width: 100%;
  min-height: 60px;
  border-radius: 13px;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease, border-color .2s ease;
}
body.it-auth-page .it-auth-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #1d5a38 0%, #173f2a 100%);
  box-shadow: 0 12px 24px rgba(27,78,49,.20);
}
body.it-auth-page .it-auth-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(27,78,49,.25);
  filter: brightness(1.05);
}
body.it-auth-page .it-auth-primary:active:not(:disabled) { transform: translateY(0); }
body.it-auth-page button:disabled { opacity: .65; cursor: wait; }
body.it-auth-page .it-auth-google {
  border: 1px solid #d8d1c6;
  color: #26332b;
  background: #fff;
  box-shadow: 0 8px 18px rgba(53,39,25,.045);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
body.it-auth-page .it-auth-google:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #c9c0b2;
  box-shadow: 0 13px 24px rgba(53,39,25,.075);
}
body.it-auth-page .it-auth-google-g {
  font-family: Arial, sans-serif;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  background: conic-gradient(from -45deg, #4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body.it-auth-page .it-auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 25px 0;
  color: #7f817e;
  font-family: Georgia, "Times New Roman", serif;
}
body.it-auth-page .it-auth-divider::before,
body.it-auth-page .it-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d6d0c5;
}
body.it-auth-page .it-auth-switch {
  margin: 28px 0 0;
  text-align: center;
  color: #4f5752;
  font-size: 14px;
}
body.it-auth-page .it-auth-footer-ornament { width: 210px; margin-top: 34px; margin-bottom: 7px; }
body.it-auth-page .it-auth-copyright {
  margin: 0;
  text-align: center;
  color: #7a7d79;
  font-size: 12px;
}
body.it-auth-page .it-auth-message {
  margin: -8px 0 18px;
  border-radius: 11px;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.45;
}
body.it-auth-page .it-auth-message[hidden] { display: none !important; }
body.it-auth-page .it-auth-message-error {
  color: #9e3535;
  background: #fff1f0;
  border: 1px solid #edc0bd;
}

/* REGISTER */
body.it-auth-page .it-auth-register-card {
  width: min(100%, 650px);
  max-height: calc(100svh - 56px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbbfae transparent;
}
body.it-auth-page .it-auth-register-card h2 { margin-bottom: 30px; }
body.it-auth-page .it-auth-role-switch {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  margin: 0 0 23px;
  background: #eee7dc;
  border-radius: 999px;
  border: 1px solid #ded4c5;
}
body.it-auth-page .it-auth-role {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: transparent;
  color: #70675b;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: .2s ease;
}
body.it-auth-page .it-auth-role.active {
  color: #fff;
  background: linear-gradient(135deg,#285f3e,#173f2a);
  box-shadow: 0 8px 18px rgba(30,78,49,.18);
}
body.it-auth-page .it-auth-extra-fields[hidden],
body.it-auth-page #learnerGoogleRegistration[hidden] { display: none !important; }
body.it-auth-page .it-auth-instructor-note,
body.it-auth-page .it-auth-security-note {
  border: 1px solid #ded2bd;
  background: #f7f1e6;
  color: #685b48;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
}
body.it-auth-page .it-auth-instructor-note { margin: 0 0 20px; display: grid; gap: 4px; }
body.it-auth-page .it-auth-security-note { margin: 20px 0 0; }
body.it-auth-page .it-auth-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* LOADING OVERLAY */
body.it-auth-page .it-auth-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(19,28,22,.44);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
body.it-auth-page .it-auth-loading.active { opacity: 1; visibility: visible; pointer-events: auto; }
body.it-auth-page .it-auth-loading-card {
  width: min(100%, 390px);
  padding: 30px 28px;
  border-radius: 24px;
  text-align: center;
  background: #fffaf2;
  box-shadow: 0 28px 70px rgba(24,20,14,.22);
  border: 1px solid rgba(108,78,49,.14);
}
body.it-auth-page .it-auth-loading-card img { width: 88px; height: 88px; object-fit: contain; }
body.it-auth-page .it-auth-loading-card h2 { margin: 12px 0 7px; color: #173f2a; font-family: Georgia,"Times New Roman",serif; }
body.it-auth-page .it-auth-loading-card p { margin: 0; color: #6d736e; line-height: 1.5; font-size: 13px; }
body.it-auth-page .it-auth-loading-dots { margin-top: 16px; display: inline-flex; gap: 7px; }
body.it-auth-page .it-auth-loading-dots span { width: 8px; height: 8px; border-radius: 999px; background: #235e3a; animation: itDot 1s infinite ease-in-out; }
body.it-auth-page .it-auth-loading-dots span:nth-child(2) { animation-delay: .15s; }
body.it-auth-page .it-auth-loading-dots span:nth-child(3) { animation-delay: .30s; }

@keyframes itDot { 0%,80%,100% { transform: scale(.7); opacity:.35; } 40% { transform: scale(1); opacity:1; } }
@keyframes itAuthRise { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform: translateY(0); } }

@media (max-width: 1050px) {
  body.it-auth-page .it-auth-shell { grid-template-columns: 1fr; }
  body.it-auth-page .it-auth-visual { min-height: 520px; padding-top: 54px; }
  body.it-auth-page .it-auth-form-panel { min-height: auto; padding: 42px 24px 58px; }
  body.it-auth-page .it-auth-register-card { max-height: none; }
}
@media (max-width: 640px) {
  body.it-auth-page .it-auth-visual { min-height: 420px; padding: 35px 22px; background-position: center 55%; }
  body.it-auth-page .it-auth-logo { width: 108px; }
  body.it-auth-page .it-auth-brand-name { font-size: 48px; }
  body.it-auth-page .it-auth-project-title { font-size: 18px; }
  body.it-auth-page .it-auth-form-panel { padding: 22px 14px 40px; }
  body.it-auth-page .it-auth-form-card { padding: 28px 20px; border-radius: 22px; }
  body.it-auth-page .it-auth-form-card h2 { font-size: 38px; margin-bottom: 28px; }
  body.it-auth-page .it-auth-input-wrap input { height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  body.it-auth-page *, body.it-auth-page *::before, body.it-auth-page *::after { animation: none !important; transition-duration: .01ms !important; }
}
