/* ==========================================================================
   EDUSPEARE - Register Pages Stylesheet (register.css)
   Used by: student-register.html (Cobalt Blue) & institute-register.html (Forest Sage)
   Clean Split Layout: Uncropped Real Campus Photography + Minimal Underline Form
   ========================================================================== */

:root {
  color-scheme: light;
  --rg-bg: #eef2fa;
  --rg-panel-bg: #1e293b;
  --rg-card: #ffffff;
  --rg-heading: #1e293b;
  --rg-ink: #0f172a;
  --rg-muted: #5b6678;
  --rg-line: #dbe2ea;
  --rg-accent: #2563eb;
  --rg-accent-hover: #1d4ed8;
  --rg-accent-ink: #ffffff;
  --rg-glow: rgba(37, 99, 235, 0.22);
  --rg-err: #dc2626;
  --rg-ok: #15803d;
  --rg-font: "Poppins", "Noto Sans Gujarati", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Student Register: Cobalt Blue */
[data-theme="cobalt"] {
  --rg-bg: #eef2fa;
  --rg-panel-bg: #1e293b;
  --rg-heading: #1e293b;
  --rg-accent: #2563eb;
  --rg-accent-hover: #1d4ed8;
  --rg-glow: rgba(37, 99, 235, 0.24);
}

/* Institute Register: Deep Forest Sage */
[data-theme="sage"] {
  --rg-bg: #ebf1ed;
  --rg-panel-bg: #1e3f35;
  --rg-heading: #1e3f35;
  --rg-accent: #1e3f35;
  --rg-accent-hover: #142b24;
  --rg-glow: rgba(30, 63, 53, 0.22);
}

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

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

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

button {
  font-family: inherit;
}

/* Off-screen Skip Link until Focused */
.skip-link,
.site-skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--rg-accent);
  color: var(--rg-accent-ink);
  font-size: 13px;
  font-weight: 600;
}

.skip-link:focus,
.site-skip-link:focus {
  top: 14px;
}

/* ==========================================================================
   1. Clean Top Header Bar
   ========================================================================== */
.reg-hdr {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.reg-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  letter-spacing: -0.025em;
  color: #1c1c1c;
}

.reg-brand svg {
  width: 28px;
  height: 25px;
  flex-shrink: 0;
}

.reg-brand span {
  font-weight: 400;
  line-height: 1;
}

.reg-brand i {
  font-style: normal;
  font-weight: 700;
  color: #e0a300;
}

.reg-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.reg-nav-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--rg-muted);
  transition: color 0.2s ease;
}

.reg-nav-link:hover {
  color: var(--rg-accent);
}

.lang {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--rg-line);
}

.lang button {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--rg-muted);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lang button.on {
  background: var(--rg-accent);
  color: var(--rg-accent-ink);
}

.reg-nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--rg-accent);
  color: var(--rg-accent-ink);
  font-size: 12.5px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.reg-nav-cta:hover {
  background: var(--rg-accent-hover);
}

/* ==========================================================================
   2. Split Register Card (Uncropped Photo Left + Clean Underline Form Right)
   ========================================================================== */
.reg-main {
  max-width: 1080px;
  margin: 4px auto 28px;
  padding: 0 24px;
}

.split-card {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  background: var(--rg-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 26px 64px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.split-card > * {
  min-width: 0;
}

/* Left Panel Base */
.split-left {
  background: var(--rg-panel-bg);
  color: #ffffff;
  display: flex;
  flex-direction: column;
}

/* Student Landscape Photo: Framed cleanly with ZERO face cropping */
.split-left.framed-photo {
  justify-content: center;
  padding: 28px 26px;
  gap: 20px;
}

.photo-frame {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0f172a;
}

.photo-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.left-copy .tg {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  margin-bottom: 10px;
}

.left-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 2.2vw, 27px);
  font-weight: 600;
  line-height: 1.2;
}

.left-copy p {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.84);
}

.left-pts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.left-pts li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.left-pts li::before {
  content: "✓";
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--rg-accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* Institute Portrait Campus Photo: Uncropped clean vertical fit */
.split-left.full-portrait {
  justify-content: center;
  align-items: center;
  padding: 0;
  background: var(--rg-panel-bg);
}

.split-left.full-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 72%;
  display: block;
}

/* Right Crisp White Form Panel */
.split-right {
  padding: 34px 40px 30px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ac > h1 {
  margin: 0 0 5px;
  text-align: center;
  font-size: clamp(24px, 2.3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rg-heading);
}

.ac > .sub {
  margin: 0 0 22px;
  text-align: center;
  font-size: 13.5px;
  color: var(--rg-muted);
}

/* Solid Red Error Flash Banner */
.reg-flash {
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--rg-err);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}

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

/* Form Grid */
.rg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.rg > div {
  min-width: 0;
}

.rg .full {
  grid-column: 1 / -1;
}

.rg-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px 14px;
}

.rg-3 > div {
  min-width: 0;
}

.fl {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--rg-muted);
  margin-bottom: 2px;
}

/* Minimal Clean Underline Input (.fi compatibility for register.js) */
.fi {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1.5px solid var(--rg-line);
  transition: border-color 0.2s ease;
  min-height: 40px;
}

.fi:focus-within {
  border-bottom-color: var(--rg-accent);
}

.fi.bad {
  border-bottom-color: var(--rg-err);
}

.fi > svg {
  width: 17px;
  height: 17px;
  stroke: #64748b;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  margin-right: 9px;
  transition: stroke 0.2s ease;
}

.fi:focus-within > svg {
  stroke: var(--rg-accent);
}

.fi .pre {
  font-size: 13px;
  font-weight: 500;
  color: var(--rg-muted);
  margin-right: 2px;
  white-space: nowrap;
}

.fi .f {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--rg-ink);
  outline: none;
}

.fi .f::placeholder {
  color: #94a3b8;
}

.fi select.f {
  cursor: pointer;
}

.eye {
  border: 0;
  background: transparent;
  padding: 6px;
  cursor: pointer;
  color: #64748b;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.eye:hover {
  color: var(--rg-accent);
}

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

/* Inline Errors (compatible with register.js show()) */
.err {
  display: none;
  color: var(--rg-err);
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 4px;
}

.fi.bad + .err {
  display: block;
}

.hint {
  display: block;
  font-size: 11.5px;
  color: var(--rg-muted);
  margin-top: 4px;
}

/* Consent Checkbox */
.fi.consent-wrap {
  border-bottom: 0;
  margin-top: 14px;
}

.chk {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #475569;
  cursor: pointer;
}

.chk input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--rg-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.fi.bad .chk {
  color: var(--rg-err);
}

/* Primary Pill Submit Button */
.rb {
  width: 100%;
  height: 46px;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  background: var(--rg-accent);
  color: var(--rg-accent-ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 22px var(--rg-glow);
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.rb:hover:not(:disabled) {
  background: var(--rg-accent-hover);
  transform: translateY(-1px);
}

.rb:disabled {
  opacity: 0.72;
  cursor: wait;
}

/* Bottom Links */
.alt {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--rg-muted);
}

.alt a {
  color: var(--rg-accent);
  font-weight: 600;
}

.alt a:hover {
  text-decoration: underline;
}

/* Success State (.done) */
.done {
  display: none;
  text-align: center;
  padding: 24px 8px;
}

.done.show {
  display: block;
}

.done .ck {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(21, 128, 61, 0.12);
  color: var(--rg-ok);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
}

.done h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--rg-heading);
}

.done p {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--rg-muted);
}

.done .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 26px;
  border-radius: 999px;
  background: var(--rg-accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
}

/* Minimal Footer */
.reg-ft {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--rg-muted);
}

.reg-ft .fk {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.reg-ft .fk a:hover {
  color: var(--rg-accent);
}

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

  body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .reg-hdr {
    padding: 10px 24px 4px;
    flex-shrink: 0;
  }

  .reg-main {
    width: 100%;
    flex: 1;
    min-height: 0;
    margin: 0 auto;
    padding: 4px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .split-card {
    width: 100%;
    max-height: calc(100dvh - 92px);
  }

  .split-left {
    max-height: calc(100dvh - 92px);
  }

  .split-left.framed-photo {
    padding: 20px 22px;
    gap: 12px;
  }

  .split-right {
    padding: 22px 32px 18px;
  }

  .ac > h1 {
    font-size: clamp(22px, 2vw, 25px);
    margin-bottom: 3px;
  }

  .ac > .sub {
    margin-bottom: 12px;
    font-size: 12.5px;
  }

  .fi {
    min-height: 35px;
  }

  .fi .f {
    padding: 6px 0;
    font-size: 13.5px;
  }

  .fi.consent-wrap {
    margin-top: 10px;
  }

  .rb {
    height: 42px;
    margin-top: 12px;
    font-size: 14px;
  }

  .alt {
    margin-top: 12px;
    font-size: 12.5px;
  }

  .reg-ft {
    width: 100%;
    padding: 4px 24px 10px;
    flex-shrink: 0;
  }
}

@media (min-width: 901px) and (max-height: 690px) {
  .split-right {
    padding: 16px 28px 14px;
  }

  .ac > h1 {
    font-size: 21px;
  }

  .ac > .sub {
    margin-bottom: 9px;
    font-size: 12px;
  }

  .rg,
  .rg-3 {
    gap: 7px 14px;
  }

  .fl {
    font-size: 11px;
    margin-bottom: 1px;
  }

  .fi {
    min-height: 32px;
  }

  .fi .f {
    padding: 4px 0;
    font-size: 13px;
  }

  .chk {
    font-size: 11.5px;
    line-height: 1.35;
  }

  .rb {
    height: 39px;
    margin-top: 9px;
  }

  .alt {
    margin-top: 9px;
    font-size: 12px;
  }
}

@media (max-width: 900px) {
  .rg-3 {
    grid-template-columns: 1fr 1fr;
  }

  .split-card {
    grid-template-columns: 1fr;
  }

  .split-left.framed-photo {
    padding: 20px;
  }

  /* Portrait image wraps cleanly at natural aspect ratio so 0% gets cropped */
  .split-left.full-portrait img {
    height: auto;
    max-height: 440px;
    object-fit: contain;
    background: var(--rg-panel-bg);
  }

  .split-right {
    padding: 28px 24px 26px;
  }
}

@media (max-width: 600px) {
  .reg-hdr {
    padding: 12px 16px 8px;
  }

  .reg-nav-cta {
    display: none;
  }

  .reg-main {
    padding: 0 14px;
    margin-bottom: 20px;
  }

  .split-right {
    padding: 24px 18px 22px;
  }

  .rg,
  .rg-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .fi .f {
    font-size: 16px; /* Prevents iOS zoom */
  }

  .reg-ft {
    padding: 12px 16px 26px;
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .reg-ft .fk {
    justify-content: center;
    gap: 12px 18px;
  }
}
