/* ==========================================================================
   EDUSPEARE - Editorial Gold Login Stylesheet (login.css)
   Matches official Gold theme (#1C1C1C + #F5B700 + #FFF9EB) & atmospheric split card design
   Used by: student-login.html & institute-login.html
   ========================================================================== */

:root {
  color-scheme: light;
  --lg-cream: #fff9eb;
  --lg-cream-top: #fffdf7;
  --lg-cream-bot: #fff6df;
  --lg-ink: #1c1c1c;
  --lg-muted: #564f40;
  --lg-soft-ink: #7d7460;
  --lg-gold: #f5b700;
  --lg-gold-hover: #e2a700;
  --lg-gold-deep: #b87c00;
  --lg-gold-soft: #f9e8b2;
  --lg-line: #eadbb2;
  --lg-white: #ffffff;
  --lg-err: #dc2626;
  --lg-err-bg: #dc2626;
  --lg-err-border: #b91c1c;
  --lg-err-ink: #ffffff;
  --lg-ok: #15803d;
  --lg-ok-bg: #ecfdf5;
  --lg-ok-border: #86efac;
  --lg-warn: #b45309;
  --lg-warn-bg: #fffbeb;
  --lg-warn-border: #fcd34d;
  --lg-info: #1d4ed8;
  --lg-info-bg: #eff6ff;
  --lg-info-border: #93c5fd;
  --lg-font: "Poppins", "Noto Sans Gujarati", -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  max-width: 100%;
  font-family: var(--lg-font);
  color: var(--lg-ink);
  background: #2f271f;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* Accessibility Skip Link */
.skip-link,
.site-skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--lg-gold);
  color: var(--lg-ink);
  font-weight: 700;
  font-size: 13px;
  transition: top 0.2s ease;
}

.skip-link:focus,
.site-skip-link:focus {
  top: 14px;
  outline: 2px solid var(--lg-ink);
}

/* ==========================================================================
   1. Full-Bleed Atmospheric Studio Scene
   ========================================================================== */
.login-scene {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #3a3026;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center bottom;
}

.login-scene[data-portal="student"] {
  background-image: url("../img/student-login-bg.jpg");
}

.login-scene[data-portal="institute"] {
  background-image: url("../img/institute-login-bg.jpg");
}

/* Soft editorial contrast scrim so left white copy & top bar read cleanly */
.login-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      100deg,
      rgba(20, 15, 10, 0.62) 0%,
      rgba(20, 15, 10, 0.34) 44%,
      rgba(20, 15, 10, 0.14) 100%
    ),
    linear-gradient(
      180deg,
      rgba(20, 15, 10, 0.32) 0%,
      rgba(20, 15, 10, 0) 24%,
      rgba(20, 15, 10, 0.22) 100%
    );
  pointer-events: none;
  z-index: 0;
}

.login-scene > * {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   2. Integrated Minimal Top Bar
   ========================================================================== */
.login-topbar {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 14px 32px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.025em;
  color: var(--lg-cream);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

.login-brand-svg {
  width: 31px;
  height: 28px;
  flex-shrink: 0;
  display: block;
}

.login-brand-word {
  font-weight: 400;
  line-height: 1;
}

.login-brand i {
  font-style: normal;
  font-weight: 700;
  color: var(--lg-gold);
}

.login-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-glass-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--lg-cream);
  background: rgba(28, 28, 28, 0.48);
  border: 1px solid rgba(255, 249, 235, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.top-glass-link:hover {
  background: rgba(28, 28, 28, 0.72);
  border-color: rgba(245, 183, 0, 0.55);
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: rgba(28, 28, 28, 0.54);
  border: 1px solid rgba(245, 183, 0, 0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lang-pill button {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--lg-cream);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.lang-pill button.on {
  background: var(--lg-gold);
  color: var(--lg-ink);
}

/* ==========================================================================
   3. Main Split Grid: Left Typography + Right Cream Floating Card
   ========================================================================== */
.login-stage {
  width: 100%;
  max-width: 1260px;
  margin: auto;
  padding: 4px 32px 8px;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(350px, 444px);
  align-items: center;
  gap: clamp(24px, 4.5vw, 56px);
}

.login-stage > * {
  min-width: 0;
}

/* Left Editorial Hero Copy */
.login-hero {
  align-self: center;
  padding-bottom: clamp(12px, 4vh, 48px);
  max-width: 540px;
  color: #ffffff;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lg-gold-soft);
  background: rgba(28, 28, 28, 0.56);
  border: 1px solid rgba(245, 183, 0, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lg-gold);
}

.login-hero h1 {
  margin: 18px 0 14px;
  font-size: clamp(34px, 4.3vw, 54px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: #fffdf8;
  text-shadow: 0 4px 24px rgba(15, 10, 5, 0.42);
}

.login-hero h1 span.accent {
  color: var(--lg-gold);
}

.login-hero p {
  margin: 0;
  max-width: 440px;
  font-size: clamp(15px, 1.45vw, 17.5px);
  line-height: 1.55;
  color: rgba(255, 249, 235, 0.92);
  text-shadow: 0 2px 14px rgba(15, 10, 5, 0.36);
}

/* Right Floating Warm Cream Card */
.login-card {
  width: 100%;
  background: linear-gradient(180deg, var(--lg-cream-top) 0%, var(--lg-cream-bot) 100%);
  border: 1px solid rgba(245, 183, 0, 0.34);
  border-radius: 24px;
  padding: 24px 28px 20px;
  box-shadow:
    0 30px 70px rgba(15, 10, 4, 0.38),
    0 4px 16px rgba(15, 10, 4, 0.14);
}

.card-head {
  text-align: center;
  margin-bottom: 14px;
}

.card-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lg-gold-soft);
  color: var(--lg-ink);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.card-head h2 {
  margin: 0 0 4px;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--lg-ink);
}

.card-head .card-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--lg-muted);
  line-height: 1.4;
}

/* ==========================================================================
   4. Flash Message Banner & Toast System (Fixed & Unified)
   ========================================================================== */
.flash-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.4;
  border: 1px solid transparent;
  animation: flashSlideIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.flash-banner[hidden] {
  display: none !important;
}

.flash-banner[data-type="error"] {
  background: var(--lg-err-bg);
  border-color: var(--lg-err-border);
  color: var(--lg-err-ink);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.24);
}

.flash-banner[data-type="error"] .flash-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.flash-banner[data-type="success"] {
  background: var(--lg-ok-bg);
  border-color: var(--lg-ok-border);
  color: var(--lg-ok);
}

.flash-banner[data-type="warning"] {
  background: var(--lg-warn-bg);
  border-color: var(--lg-warn-border);
  color: var(--lg-warn);
}

.flash-banner[data-type="info"] {
  background: var(--lg-info-bg);
  border-color: var(--lg-info-border);
  color: var(--lg-info);
}

.flash-banner.shake {
  animation: flashShake 0.36s ease;
}

.flash-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.flash-body {
  flex: 1;
  min-width: 0;
  font-weight: 500;
}

.flash-action {
  display: inline-block;
  margin-top: 4px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.flash-close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  opacity: 0.72;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 18px;
  line-height: 1;
  border-radius: 6px;
}

.flash-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

@keyframes flashSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes flashShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* Floating Toast Notification */
.flash-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 16px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--lg-ink);
  color: var(--lg-cream);
  border: 1px solid rgba(245, 183, 0, 0.45);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.flash-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.flash-toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lg-gold);
  flex-shrink: 0;
}

/* ==========================================================================
   5. Form Controls (Clean Soft Inputs & Eye Toggle)
   ========================================================================== */
.field-group {
  margin-bottom: 12px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--lg-ink);
  margin-bottom: 5px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--lg-white);
  border: 1.5px solid var(--lg-line);
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap:focus-within {
  border-color: var(--lg-gold-deep);
  box-shadow: 0 0 0 3.5px rgba(245, 183, 0, 0.24);
}

.input-wrap.bad {
  border-color: var(--lg-err);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--lg-soft-ink);
  pointer-events: none;
  display: grid;
  place-items: center;
}

.input-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-control {
  width: 100%;
  height: 44px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 0 44px 0 42px;
  font-family: inherit;
  font-size: 14px;
  color: var(--lg-ink);
  outline: none;
}

.input-control::placeholder {
  color: #9e9480;
}

/* Eye Toggle Button */
.eye-btn {
  position: absolute;
  right: 6px;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--lg-soft-ink);
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.eye-btn:hover {
  color: var(--lg-ink);
  background: rgba(245, 183, 0, 0.14);
}

.eye-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eye-btn .eye-closed {
  display: none;
}

.eye-btn.showing .eye-open {
  display: none;
}

.eye-btn.showing .eye-closed {
  display: block;
}

/* Inline Field Error */
.field-err {
  display: none;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--lg-err);
  line-height: 1.35;
}

.input-wrap.bad + .field-err {
  display: block;
}

/* Remember & Forgot Row */
.login-opts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 14px;
  font-size: 12.5px;
}

.remember-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--lg-muted);
  cursor: pointer;
  user-select: none;
}

.remember-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--lg-gold-deep);
  cursor: pointer;
}

.forgot-link {
  margin-left: auto;
  color: var(--lg-ink);
  font-weight: 600;
  transition: color 0.18s ease;
}

.forgot-link:hover {
  color: var(--lg-gold-deep);
  text-decoration: underline;
}

/* Primary Gold Submit Button */
.login-submit {
  width: 100%;
  height: 45px;
  border: 0;
  border-radius: 12px;
  background: var(--lg-gold);
  color: var(--lg-ink);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(245, 183, 0, 0.28);
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.login-submit:hover:not(:disabled) {
  background: var(--lg-gold-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(245, 183, 0, 0.36);
}

.login-submit:active:not(:disabled) {
  transform: translateY(0);
}

.login-submit:disabled {
  opacity: 0.78;
  cursor: wait;
}

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2.2px solid rgba(28, 28, 28, 0.25);
  border-top-color: var(--lg-ink);
  border-radius: 50%;
  animation: spinLoader 0.7s linear infinite;
}

.login-submit.loading .btn-spinner {
  display: inline-block;
}

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

/* "or" Divider */
.login-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  color: var(--lg-soft-ink);
  font-size: 12px;
  font-weight: 500;
}

.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--lg-line);
}

/* Secondary White Pill Action Button */
.login-alt-btn {
  width: 100%;
  height: 43px;
  border-radius: 12px;
  background: var(--lg-white);
  border: 1.5px solid var(--lg-line);
  color: var(--lg-ink);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.login-alt-btn:hover {
  border-color: var(--lg-gold-deep);
  background: #fffdf8;
  transform: translateY(-1px);
}

.login-alt-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--lg-gold-deep);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Card Bottom Links */
.login-card-foot {
  margin-top: 14px;
  text-align: center;
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--lg-muted);
}

.login-card-foot a.strong-link {
  color: var(--lg-gold-deep);
  font-weight: 700;
}

.login-card-foot a.strong-link:hover {
  text-decoration: underline;
}

.login-card-foot .preview-row {
  font-size: 12px;
  color: var(--lg-soft-ink);
}

.login-card-foot .preview-row a {
  color: var(--lg-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==========================================================================
   6. Minimal Bottom Legal Strip
   ========================================================================== */
.login-foot {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 4px 32px 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(255, 249, 235, 0.78);
}

.login-foot-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.login-foot-links a:hover {
  color: var(--lg-gold);
}

/* ==========================================================================
   7. Single-Viewport Desktop Lock & Responsive Breakpoints
   ========================================================================== */
@media (min-width: 921px) and (min-height: 540px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .login-scene {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }
}

@media (min-width: 921px) and (max-height: 670px) {
  .login-topbar {
    padding: 10px 32px 2px;
  }

  .login-card {
    padding: 18px 24px 16px;
    border-radius: 22px;
  }

  .card-head {
    margin-bottom: 10px;
  }

  .card-head h2 {
    font-size: 20px;
  }

  .flash-banner {
    padding: 8px 11px;
    margin-bottom: 10px;
    font-size: 12.5px;
  }

  .field-group {
    margin-bottom: 8px;
  }

  .field-label {
    font-size: 12.5px;
    margin-bottom: 4px;
  }

  .input-control {
    height: 40px;
  }

  .login-opts {
    margin: 2px 0 10px;
  }

  .login-submit {
    height: 41px;
  }

  .login-or {
    margin: 9px 0;
  }

  .login-alt-btn {
    height: 39px;
  }

  .login-card-foot {
    margin-top: 10px;
    gap: 3px;
    font-size: 12.5px;
  }
}

@media (max-width: 920px) {
  .login-stage {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 12px 20px 24px;
  }

  .login-hero {
    padding-top: 10px;
    max-width: 100%;
  }

  .login-card {
    max-width: 460px;
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .login-topbar {
    padding: 14px 16px 8px;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .login-brand {
    font-size: 19px;
    flex-shrink: 0;
  }

  .login-top-actions {
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .top-glass-link.hide-xs {
    display: none;
  }

  .top-glass-link {
    padding: 6px 11px;
    font-size: 12px;
    white-space: nowrap;
  }

  .lang-pill button {
    padding: 4px 8px;
    font-size: 11px;
  }

  .login-stage {
    padding: 8px 14px 20px;
    gap: 18px;
  }

  .login-hero {
    padding-top: 2px;
  }

  .login-hero h1 {
    font-size: clamp(26px, 7.2vw, 32px);
    margin: 12px 0 8px;
  }

  .login-hero p {
    font-size: 14px;
  }

  .login-card {
    padding: 24px 18px 22px;
    border-radius: 22px;
  }

  .input-control {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  .login-foot {
    padding: 10px 16px 22px;
    flex-direction: column-reverse;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 8px;
  }

  .login-foot-links {
    justify-content: center;
    gap: 12px 16px;
  }
}

@media (max-width: 440px) {
  .login-top-actions .top-glass-link {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
