/* Lernmark auth pages - aligned with the public marketing system. */

:root {
  --navy: #1a2744;
  --navy-d: #111b33;
  --navy-m: #243158;
  --navy-lt: #2e3f6e;
  --gold: #c9a96e;
  --gold-lt: #e8cc9a;
  --gold-pale: #f7f0e2;
  --purple: #5b4fcf;
  --purple-lt: #ede9ff;
  --white: #ffffff;
  --off: #f8f8fc;
  --border: #e4e8f0;
  --text: #1a2744;
  --muted: #6b7a99;
  --danger: #dc2626;
  --success: #15803d;
  --warning: #c2410c;
  --radius: 8px;
}

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

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body.auth-body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(247, 240, 226, 0.82), rgba(255, 255, 255, 0.72) 42%, rgba(237, 233, 255, 0.68)),
    var(--off);
  font-family: 'Inter', Arial, sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(22rem, 0.86fr) minmax(25rem, 1.14fr);
}

.auth-hero,
.auth-panel {
  position: relative;
  min-width: 0;
  padding: 2rem;
}

.auth-hero {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(150deg, var(--navy-d) 0%, var(--navy) 58%, #283965 100%);
  background-size: 3rem 3rem, 3rem 3rem, auto;
}

.auth-hero::after {
  content: "";
  position: absolute;
  right: -7rem;
  bottom: -10rem;
  width: 22rem;
  height: 28rem;
  border: 1px solid rgba(201, 169, 110, 0.24);
  transform: rotate(28deg);
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid rgba(26, 39, 68, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 248, 252, 0.9)),
    var(--off);
}

.auth-hero__inner,
.auth-panel__inner {
  position: relative;
  z-index: 1;
  width: 100%;
}

.auth-hero__inner {
  max-width: 34rem;
  min-height: 100%;
  display: grid;
  align-content: space-between;
  gap: 2rem;
}

.auth-panel__inner {
  max-width: 31rem;
}

.auth-panel__inner--wide {
  max-width: 46rem;
}

.auth-brand,
.auth-brand--panel {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  color: var(--white);
}

.auth-brand--panel {
  color: var(--text);
}

.auth-brand__logo {
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 2.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(201, 169, 110, 0.38);
  object-fit: cover;
  background: var(--navy-d);
}

.auth-brand__copy {
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}

.auth-brand__copy strong {
  font-family: 'Sora', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.auth-brand__copy span {
  overflow-wrap: break-word;
  word-break: normal;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-brand--panel .auth-brand__copy span {
  color: var(--muted);
}

.auth-panel-brand {
  display: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  min-height: 2rem;
  padding: 0.45rem 0.72rem;
  border: 1px solid rgba(201, 169, 110, 0.24);
  border-radius: 999px;
  background: rgba(201, 169, 110, 0.12);
  color: var(--gold-lt);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-eyebrow--light {
  border-color: rgba(91, 79, 207, 0.14);
  background: var(--purple-lt);
  color: var(--purple);
}

.auth-hero__copy {
  display: grid;
  gap: 0.9rem;
}

.auth-hero__copy h1 {
  max-width: 13ch;
  margin: 0;
  color: var(--white);
  font-family: 'Sora', Arial, sans-serif;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.02;
  text-wrap: balance;
}

.auth-hero__copy p {
  max-width: 34rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1rem;
  line-height: 1.7;
}

.auth-stats {
  display: grid;
  gap: 0.75rem;
}

.auth-stat {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(4.9rem, auto) 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.78rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(14px);
}

.auth-stat__value {
  color: var(--gold-lt);
  font-family: 'Sora', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.auth-stat__label {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-stat__text {
  grid-column: 1 / -1;
  margin: -0.3rem 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.84rem;
  line-height: 1.55;
}

.auth-surface {
  display: none;
}

.auth-card {
  position: relative;
  width: 100%;
  padding: 1.5rem;
  border: 1px solid rgba(26, 39, 68, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1.5rem 3.5rem rgba(17, 27, 51, 0.11);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0.55rem;
  pointer-events: none;
  border: 1px solid rgba(201, 169, 110, 0.12);
  border-radius: calc(var(--radius) - 2px);
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-card__header {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.auth-card__header h2 {
  margin: 0;
  color: var(--navy-d);
  font-family: 'Sora', Arial, sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
  text-wrap: balance;
}

.auth-card__header p {
  max-width: 35rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.82rem 0.9rem;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 0.92rem;
  line-height: 1.55;
}

.auth-alert i {
  margin-top: 0.18rem;
  flex: 0 0 auto;
}

.auth-alert strong {
  display: block;
  margin-bottom: 0.1rem;
  font-weight: 800;
}

.auth-alert--info {
  border-color: rgba(91, 79, 207, 0.18);
  background: rgba(237, 233, 255, 0.72);
  color: #4639b8;
}

.auth-alert--success {
  border-color: rgba(21, 128, 61, 0.18);
  background: rgba(220, 252, 231, 0.78);
  color: var(--success);
}

.auth-alert--warning {
  border-color: rgba(194, 65, 12, 0.18);
  background: rgba(255, 237, 213, 0.78);
  color: var(--warning);
}

.auth-alert--danger {
  border-color: rgba(220, 38, 38, 0.18);
  background: rgba(254, 226, 226, 0.78);
  color: var(--danger);
}

.auth-form,
.auth-form-grid,
.auth-helper-grid {
  display: grid;
  gap: 0.9rem;
}

.auth-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-field {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
}

.auth-field--span-2 {
  grid-column: span 2;
}

.auth-field label {
  color: var(--navy-d);
  font-size: 0.86rem;
  font-weight: 800;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  left: 0.92rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.94rem;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.86rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: #fbfcff;
  font-size: 0.95rem;
  line-height: 1.3;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.auth-input--with-icon {
  padding-left: 2.75rem;
}

.auth-input::placeholder {
  color: #8a96b3;
}

.auth-input:focus {
  outline: 0;
  border-color: rgba(91, 79, 207, 0.66);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(91, 79, 207, 0.12);
}

select.auth-input {
  appearance: none;
  padding-right: 2.75rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) calc(50% - 3px),
    calc(100% - 0.82rem) calc(50% - 3px);
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
}

.auth-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.auth-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.auth-check input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.18rem;
  flex: 0 0 auto;
  accent-color: var(--purple);
}

.auth-link,
.auth-links a,
.auth-check a {
  color: var(--purple);
  font-weight: 800;
}

.auth-link:hover,
.auth-links a:hover,
.auth-check a:hover {
  color: var(--navy-d);
}

.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.85rem 1.1rem;
  border: 0;
  border-radius: var(--radius);
  color: var(--navy-d);
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  box-shadow: 0 0.9rem 1.8rem rgba(201, 169, 110, 0.22);
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.auth-button:hover,
.auth-button:focus {
  transform: translateY(-1px);
  filter: saturate(1.05);
  box-shadow: 0 1.1rem 2.2rem rgba(201, 169, 110, 0.28);
}

.auth-button:focus-visible,
.auth-link:focus-visible,
.auth-links a:focus-visible,
.auth-brand:focus-visible {
  outline: 3px solid rgba(91, 79, 207, 0.24);
  outline-offset: 3px;
}

.auth-divider {
  height: 1px;
  margin: 1rem 0;
  border: 0;
  background: var(--border);
}

.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.auth-helper-grid {
  margin-top: 1rem;
}

.auth-helper-grid--split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-helper-card {
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid rgba(26, 39, 68, 0.08);
  border-radius: var(--radius);
  background: rgba(248, 248, 252, 0.82);
}

.auth-helper-card h3 {
  margin: 0 0 0.25rem;
  color: var(--navy-d);
  font-family: 'Sora', Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-helper-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.auth-links {
  display: flex;
  gap: 0.7rem 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-links a {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
}

@media (max-width: 1180px) {
  .auth-shell {
    display: block;
  }

  .auth-hero {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    border-left: 0;
  }

  .auth-panel-brand {
    display: flex;
  }
}

@media (max-width: 760px) {
  body.auth-body {
    background: var(--off);
  }

  .auth-panel {
    align-items: flex-start;
    padding: 1rem;
  }

  .auth-panel-brand {
    display: grid;
  }

  .auth-card {
    padding: 1.15rem;
    box-shadow: 0 1rem 2.4rem rgba(17, 27, 51, 0.1);
  }

  .auth-card::before {
    display: none;
  }

  .auth-card__header h2 {
    font-size: 1.55rem;
  }

  .auth-form-grid,
  .auth-helper-grid--split {
    grid-template-columns: 1fr;
  }

  .auth-field--span-2 {
    grid-column: auto;
  }

  .auth-inline,
  .auth-links {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (min-width: 1181px) and (max-height: 720px) {
  .auth-hero,
  .auth-panel {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .auth-hero__inner {
    gap: 1.2rem;
  }

  .auth-hero__copy h1 {
    font-size: 2.45rem;
  }

  .auth-stat__text {
    display: none;
  }
}
