/* ==========================================================================
   CampusConnect: sign-in and account pages
   Requires cc-design.css (tokens + fonts).
   Light, bright academic design with soft blue accents.
   ========================================================================== */

/* ---- Sign in: split layout ---------------------------------------------- */

.lg {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: block;
  padding: 0;
  background: #F5F8FC;
}

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

.lg::before,
.lg::after {
  content: none;
}

.lg-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px clamp(16px, 3vw, 40px);
  background:
    radial-gradient(circle at 12% 8%, rgba(120, 181, 232, 0.35) 0%, transparent 52%),
    radial-gradient(circle at 92% 92%, rgba(76, 154, 112, 0.18) 0%, transparent 46%),
    linear-gradient(165deg, #DCEBFA 0%, #EAF2FA 45%, #F5F8FC 100%);
}

/* ---- The card: two panels, scalloped seam between them ------------------- */

.lg-card {
  position: relative;
  width: 100%;
  max-width: 1080px;
  min-height: min(600px, 84vh);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: #FFFFFF;
  border-radius: 28px;
  box-shadow: 0 28px 64px -20px rgba(27, 43, 82, 0.28), 0 1px 0 rgba(27, 43, 82, 0.04);
  overflow: hidden;
}

/* ---- Promo panel ----------------------------------------------------------
   The campus photo from the old design, with a navy-to-sky brand tint over
   it so the photo still reads as CampusConnect and white text stays legible. */

.lg-promo {
  position: relative;
  z-index: 1;
  order: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 28px;
  padding: clamp(32px, 4vw, 52px) clamp(28px, 4vw, 48px) 40px;
  color: #FFFFFF;
  background:
    linear-gradient(165deg, rgba(16, 29, 58, 0.90) 0%, rgba(32, 68, 118, 0.82) 48%, rgba(44, 100, 160, 0.72) 100%),
    url('../images/login-background.jpg?v=2') center / cover no-repeat;
  overflow: hidden;
}

.lg-promo-top {
  position: relative;
}

/* Brand lockup: just the wordmark, straight on the photo — the gradient
   tint keeps it legible without needing a card or icon behind it. */
.lg-promo-brand {
  margin-bottom: 20px;
}

.lg-promo-eyebrow {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 500;
  color: #CFE4F7;
}

.lg-promo-word {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 1.5rem + 2vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.lg-promo-word span {
  color: #BFE3FF;
}

.lg-promo-lede {
  margin: 0;
  max-width: 30em;
  font-size: 1.05rem;
  line-height: 1.68;
  color: #EAF3FC;
}

/* ---- Form panel ------------------------------------------------------------ */

.lg-side {
  position: relative;
  z-index: 1;
  order: 2;
  width: 100%;
  background: #FFFFFF;
  padding: clamp(32px, 4.5vw, 56px) clamp(28px, 4.5vw, 52px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lg-wrap {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.lg-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 6px;
  color: #263451;
}

.lg-sub {
  color: #5B6A82;
  margin: 0 0 28px;
  font-size: 0.95rem;
}

/* ---- Alerts -------------------------------------------------------------- */

.lg-alert {
  border-left: 3px solid var(--red);
  background: #FFF1F1;
  color: #852F35;
  padding: 11px 14px;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 0.9rem;
  margin-bottom: 22px;
}

.lg-alert.ok {
  border-left-color: #4C9A70;
  background: #ECF8F0;
  color: #21643D;
}

/* ---- Form fields --------------------------------------------------------- */

.lg-field {
  margin-bottom: 20px;
}

.lg-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #34435F;
  margin-bottom: 7px;
}

.lg-field input[type="text"],
.lg-field input[type="email"],
.lg-field input[type="password"] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 1rem;
  color: #263451;
  background: #FFFFFF;
  border: 1px solid #DFE7F0;
  border-radius: var(--r-md);
  transition:
    border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    background-color 0.15s var(--ease);
}

.lg-field input::placeholder {
  color: #67758C;
}

.lg-field input:hover {
  border-color: #A9CDEB;
}

.lg-field input:focus {
  outline: none;
  border-color: #438CC9;
  box-shadow: 0 0 0 3px rgba(67, 140, 201, 0.14);
}

.lg-field input[aria-invalid="true"] {
  border-color: var(--red);
}

.lg-field input[readonly] {
  background: #F5F8FC;
  color: #5B6A82;
  cursor: not-allowed;
}

.lg-field input[readonly]:focus {
  box-shadow: none;
  border-color: #DFE7F0;
}

.lg-hint {
  margin: 7px 0 0;
  font-size: 0.82rem;
  color: #5B6A82;
  line-height: 1.5;
}

/* ---- Password visibility toggle ----------------------------------------- */

.lg-pw {
  position: relative;
}

.lg-pw input {
  padding-right: 48px;
}

.lg-pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 46px;
  width: 46px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: #5B6A82;
  cursor: pointer;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  transition: color 0.15s ease;
}

.lg-pw-toggle:hover {
  color: #397FBE;
}

.lg-pw-toggle:focus-visible {
  outline: 2px solid #438CC9;
  outline-offset: -3px;
}

.lg-pw-toggle svg {
  width: 18px;
  height: 18px;
}

.lg-pw-toggle .off {
  display: none;
}

.lg-pw-toggle[aria-pressed="true"] .on {
  display: none;
}

.lg-pw-toggle[aria-pressed="true"] .off {
  display: block;
}

/* ---- Remember me and links ---------------------------------------------- */

.lg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 24px;
  font-size: 0.9rem;
}

.lg-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #52617A;
  cursor: pointer;
  min-height: 24px;
}

.lg-check input {
  width: 18px;
  height: 18px;
  accent-color: #397FBE;
  margin: 0;
  cursor: pointer;
}

.lg a {
  color: #3278B5;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.lg a:hover {
  color: #245C91;
}

/* ---- Primary button ------------------------------------------------------ */

.lg-btn {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #FFFFFF;
  background: linear-gradient(120deg, #397FBE, #69A9DF);
  border: 0;
  border-radius: var(--r-md);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(57, 127, 190, 0.16);
  transition:
    filter 0.15s var(--ease),
    transform 0.08s var(--ease),
    box-shadow 0.15s var(--ease);
}

.lg-btn:hover {
  filter: brightness(1.04);
  box-shadow: 0 6px 16px rgba(57, 127, 190, 0.22);
}

.lg-btn:active {
  transform: translateY(1px);
}

.lg-btn:focus-visible {
  outline: 3px solid rgba(57, 127, 190, 0.3);
  outline-offset: 3px;
}

.lg-btn:disabled {
  opacity: 0.7;
  cursor: progress;
}

.lg-btn:disabled::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #FFFFFF;
  animation: lg-spin 0.7s linear infinite;
}

@keyframes lg-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Back-to-login link (forgot password) -------------------------------- */

.lg-back {
  display: block;
  text-align: center;
  margin-top: 22px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ---- Setup badge pill (complete profile) ---------------------------------- */

.lg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EAF3FC;
  color: #2A6399;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* ---- Signed-in-as user card (complete profile) ----------------------------- */

.lg-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #F5F8FC;
  border: 1px solid #E5ECF4;
  border-radius: var(--r-md);
  margin-bottom: 20px;
}

.lg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(120deg, #397FBE, #69A9DF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #FFFFFF;
  flex-shrink: 0;
}

.lg-user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #263451;
}

.lg-user-role {
  font-size: 0.78rem;
  color: #5B6A82;
  margin-top: 2px;
}

/* ---- Divider between field groups (complete profile) ----------------------- */

.lg-divider {
  height: 1px;
  background: #E5ECF4;
  margin: 18px 0;
}

/* ---- Footer -------------------------------------------------------------- */

.lg-foot {
  margin: 0;
  width: 100%;
  padding-top: 18px;
  border-top: 1px solid #E5ECF4;
  font-size: 0.85rem;
  color: #5B6A82;
}

/* ---- Responsive layout --------------------------------------------------- */

@media (max-width: 860px) {
  .lg-shell {
    align-items: flex-start;
    padding: 20px 14px;
  }

  .lg-card {
    grid-template-columns: 1fr;
    max-width: 440px;
    border-radius: 26px;
  }

  /* Promo becomes a centered hero band, like the inspiration's mobile card:
     logo + wordmark stacked and centered on the blue panel, full brand color.
     The form panel (.lg-side) now comes first in the DOM so desktop can put
     it on the left, so pull the promo panel back above it visually here. */
  .lg-promo {
    order: -1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0;
    padding: 48px 28px 56px;
  }

  .lg-promo-top {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .lg-promo-brand {
    margin-bottom: 14px;
  }

  .lg-promo-word {
    font-size: 1.6rem;
  }

  .lg-promo-lede {
    display: none;
  }

  .lg-side {
    padding: 32px 24px 32px;
    margin-top: -24px;
    border-radius: 24px 24px 0 0;
    background: #FFFFFF;
  }

  .lg-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .lg-shell {
    padding: 0;
  }

  .lg-card {
    border-radius: 0;
    min-height: 100dvh;
  }

  .lg-promo {
    padding: 40px 24px 60px;
  }

  .lg-side {
    padding: 28px 20px 28px;
    justify-content: flex-start;
  }

  .lg-title {
    font-size: 1.5rem;
  }

  .lg-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

/* ---- Other account pages: forgot / reset / complete profile -------------- */

body:not(.lg) {
  background-color: #F5F8FC;
  background-image: url('../images/login-background.jpg?v=2');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  justify-content: center;
  padding: 24px 16px;
}

body:not(.lg)::after {
  display: none;
}

body:not(.lg) .login-wrapper,
body:not(.lg) .wrap {
  animation: none;
}

/* Brand */

body:not(.lg) .logo-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: -0.015em;
  color: var(--logo-blue);
}

body:not(.lg) .logo-text span {
  color: var(--logo-green);
}

/* Cards */

body:not(.lg) .card {
  border: 1px solid #E2EAF3;
  border-radius: var(--r-lg);
  box-shadow: 0 14px 42px rgba(40, 65, 100, 0.10);
  background: #FFFFFF;
}

body:not(.lg) .card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  color: #263451;
}

body:not(.lg) .card-sub {
  font-size: 0.9rem;
  color: #5B6A82;
  font-weight: 400;
}

/* Form labels and fields */

body:not(.lg) .field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #34435F;
  text-transform: none;
  letter-spacing: 0;
}

body:not(.lg) .field input,
body:not(.lg) .field select,
body:not(.lg) .field textarea {
  background: #FFFFFF;
  color: #263451;
  border: 1px solid #DFE7F0;
  border-radius: var(--r-md);
  font-size: 1rem;
  min-height: 44px;
}

body:not(.lg) .field input::placeholder,
body:not(.lg) .field textarea::placeholder {
  color: #67758C;
}

body:not(.lg) .field input:hover,
body:not(.lg) .field select:hover,
body:not(.lg) .field textarea:hover {
  border-color: #A9CDEB;
}

body:not(.lg) .field input:focus,
body:not(.lg) .field select:focus,
body:not(.lg) .field textarea:focus {
  border-color: #438CC9;
  box-shadow: 0 0 0 3px rgba(67, 140, 201, 0.14);
  outline: none;
}

/* Submit button */

body:not(.lg) .btn-submit {
  color: #FFFFFF;
  background: linear-gradient(120deg, #397FBE, #69A9DF);
  border: none;
  border-radius: var(--r-md);
  box-shadow: 0 4px 12px rgba(57, 127, 190, 0.16);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  min-height: 46px;
  transition:
    filter 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.08s ease;
}

body:not(.lg) .btn-submit:hover {
  filter: brightness(1.04);
  transform: none;
  box-shadow: 0 6px 16px rgba(57, 127, 190, 0.22);
}

body:not(.lg) .btn-submit:active {
  transform: translateY(1px);
}

/* Feedback messages */

body:not(.lg) .alert-error {
  border-radius: var(--r-md);
  background: #FFF1F1;
  color: #852F35;
  border-color: #E9A7AA;
}

body:not(.lg) .alert-success {
  border-radius: var(--r-md);
  background: #ECF8F0;
  color: #21643D;
  border-color: #A9D9B9;
}

/* Existing wordmark, title, subtitle and background decoration */

body:not(.lg) .bg-blob {
  display: none;
}

body:not(.lg) .wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.015em;
  color: var(--logo-blue);
}

body:not(.lg) .wordmark span {
  color: var(--logo-green);
}

body:not(.lg) .title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  color: #263451;
  line-height: 1.15;
}

body:not(.lg) .sub {
  font-size: 0.9rem;
  color: #5B6A82;
  font-weight: 400;
  line-height: 1.55;
}

body:not(.lg) .back-link {
  color: #3278B5;
  font-weight: 500;
}

body:not(.lg) .back-link:hover {
  color: #245C91;
}

body:not(.lg) .card {
  padding-left: clamp(22px, 5vw, 36px);
  padding-right: clamp(22px, 5vw, 36px);
}