/* Library landing — SmartEduHub style */
:root {
  --lh-blue: #2c8cff;
  --lh-blue-deep: #1a73e8;
  --lh-blue-soft: #e8f3ff;
  --lh-blue-pill: #d6ebff;
  --lh-ink: #1e3a5f;
  --lh-text: #4a5d73;
  --lh-muted: #7a8ea3;
  --lh-line: #d7e4f2;
  --lh-bg0: #f4f9ff;
  --lh-bg1: #eef5fc;
  --lh-white: #ffffff;
  --lh-max: 1100px;
  --lh-font: "Roboto Condensed", "RC Fallback", "Segoe UI", sans-serif;
  --lh-radius: 14px;
  --lh-shadow: 0 10px 30px rgba(30, 90, 160, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.lh {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--lh-font);
  color: var(--lh-ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(44, 140, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 10%, rgba(34, 206, 233, 0.1), transparent 50%),
    linear-gradient(180deg, var(--lh-bg0) 0%, var(--lh-bg1) 45%, #f7fbff 100%);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.lh > main {
  flex: 1 0 auto;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.lh-wrap {
  width: min(100% - 2.5rem, var(--lh-max));
  margin-inline: auto;
}

/* —— Header —— */
.lh-header {
  background: #fff;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(215, 228, 242, 0.85);
}

.lh-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4rem;
}

.lh-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.lh-brand__logo {
  height: 52px;
  width: auto;
  max-width: min(280px, 52vw);
  object-fit: contain;
  object-position: left center;
}

.lh-nav-wrap {
  margin-left: auto;
}

.lh-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lh-nav a {
  display: inline-block;
  padding: 0.55rem 1.05rem;
  border-radius: 8px;
  font-size: 0.975rem;
  font-weight: 600;
  color: #2c3e50;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.lh-nav a:hover {
  color: #1a73e8;
  background: rgba(44, 140, 255, 0.08);
}

.lh-nav a.is-active {
  background: #e3f0ff;
  color: #1e3a5f;
  font-weight: 700;
}

.lh-nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--lh-line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

.lh-nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 0.28rem auto;
  background: var(--lh-ink);
}

/* —— Hero —— */
.lh-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(410px, 46vw, 500px);
  padding: 3.6rem 0 3.35rem;
  overflow: hidden;
  background: var(--lh-bg0);
}

.lh-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.lh-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 18% center;
  display: block;
  transform: scale(1.02);
}

/* Зүүнээс баруун руу уусгах + доод тал руу цайруулах */
.lh-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(244, 249, 255, 0) 0%,
      rgba(244, 249, 255, 0.12) 18%,
      rgba(244, 249, 255, 0.55) 36%,
      rgba(247, 251, 255, 0.88) 52%,
      #f7fbff 68%,
      #f7fbff 100%
    ),
    linear-gradient(
      180deg,
      rgba(244, 249, 255, 0.15) 0%,
      transparent 18%,
      transparent 78%,
      rgba(247, 251, 255, 0.55) 100%
    );
}

.lh-hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-right: clamp(3rem, 16vw, 11rem);
}

.lh-hero__copy {
  width: min(100%, 28.5rem);
  animation: lhFadeUp 0.75s ease 0.08s both;
}

@keyframes lhFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Laptop mockup */
.lh-laptop {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  filter: drop-shadow(0 24px 40px rgba(30, 80, 150, 0.18));
}

.lh-laptop__screen {
  background: #1c2430;
  border: 10px solid #2a3340;
  border-bottom-width: 6px;
  border-radius: 14px 14px 4px 4px;
  overflow: hidden;
  aspect-ratio: 16 / 10.5;
}

.lh-laptop__bezel {
  height: 100%;
  background: #f7fafc;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lh-laptop__chrome {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  background: #eef2f7;
  border-bottom: 1px solid #e2e8f0;
}

.lh-laptop__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
}

.lh-laptop__dot:nth-child(1) { background: #f87171; }
.lh-laptop__dot:nth-child(2) { background: #fbbf24; }
.lh-laptop__dot:nth-child(3) { background: #34d399; }

.lh-laptop__url {
  flex: 1;
  margin-left: 0.4rem;
  height: 1.1rem;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 0.55rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  padding: 0 0.4rem;
}

.lh-app {
  flex: 1;
  padding: 0.55rem 0.65rem 0.7rem;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5fc 100%);
  min-height: 0;
}

.lh-app__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.lh-app__title {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--lh-ink);
}

.lh-app__search {
  flex: 1;
  max-width: 55%;
  height: 1.15rem;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #dbe7f3;
  font-size: 0.5rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  padding: 0 0.4rem;
  gap: 0.25rem;
}

.lh-app__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.lh-book {
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e4eef8;
  padding: 0.3rem;
  box-shadow: 0 2px 6px rgba(30, 90, 160, 0.05);
}

.lh-book__cover {
  height: 2.6rem;
  border-radius: 4px;
  margin-bottom: 0.25rem;
}

.lh-book__cover--1 { background: linear-gradient(145deg, #60a5fa, #2563eb); }
.lh-book__cover--2 { background: linear-gradient(145deg, #34d399, #059669); }
.lh-book__cover--3 { background: linear-gradient(145deg, #fbbf24, #d97706); }
.lh-book__cover--4 { background: linear-gradient(145deg, #a78bfa, #7c3aed); }
.lh-book__cover--5 { background: linear-gradient(145deg, #fb7185, #e11d48); }
.lh-book__cover--6 { background: linear-gradient(145deg, #22d3ee, #0891b2); }
.lh-book__cover--7 { background: linear-gradient(145deg, #94a3b8, #475569); }
.lh-book__cover--8 { background: linear-gradient(145deg, #4ade80, #16a34a); }

.lh-book__line {
  height: 3px;
  border-radius: 2px;
  background: #e2e8f0;
  margin-bottom: 3px;
}

.lh-book__line--short {
  width: 60%;
}

.lh-book__badge {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.4rem;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  background: #dcfce7;
  color: #15803d;
}

.lh-laptop__base {
  height: 12px;
  background: linear-gradient(180deg, #3a4554, #2a3340);
  border-radius: 0 0 10px 10px;
  margin: 0 8%;
  position: relative;
}

.lh-laptop__base::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  transform: translateX(-50%);
  width: 18%;
  height: 4px;
  border-radius: 2px;
  background: #1c2430;
}

.lh-laptop__shadow {
  height: 18px;
  margin: 0 5%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(30, 80, 150, 0.2), transparent 70%);
}

.lh-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--lh-blue-pill);
  color: var(--lh-blue-deep);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.lh-hero__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.85rem, 3.4vw, 2.55rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--lh-ink);
  letter-spacing: -0.02em;
}

.lh-hero__sub {
  margin: 0 0 0.75rem;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  font-weight: 600;
  color: var(--lh-blue);
}

.lh-hero__text {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  color: var(--lh-text);
  max-width: 32rem;
  line-height: 1.65;
}

.lh-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.lh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8.5rem;
  padding: 0.7rem 1.35rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.975rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.lh-btn:hover {
  transform: translateY(-1px);
}

.lh-btn--primary {
  background: linear-gradient(135deg, #2c8cff 0%, #1a7aef 100%);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 8px 20px rgba(44, 140, 255, 0.28);
}

.lh-btn--primary:hover {
  box-shadow: 0 10px 24px rgba(44, 140, 255, 0.35);
}

.lh-btn--outline {
  background: #fff;
  color: var(--lh-blue);
  border: 1.5px solid var(--lh-blue);
}

.lh-btn--outline:hover {
  background: var(--lh-blue-soft);
}

/* —— Features —— */
.lh-features {
  padding: 4rem 0 3.5rem;
}

.lh-features__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.lh-card {
  background: var(--lh-white);
  border: 1px solid rgba(215, 228, 242, 0.9);
  border-radius: var(--lh-radius);
  padding: 1.25rem 1.15rem 1.35rem;
  box-shadow: var(--lh-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.lh-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(30, 90, 160, 0.12);
}

.lh-card__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--lh-blue-soft);
  color: var(--lh-blue);
  display: grid;
  place-items: center;
  margin-bottom: 0.85rem;
}

.lh-card__icon svg {
  width: 1.2rem;
  height: 1.2rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.lh-card__title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--lh-ink);
}

.lh-card__text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--lh-muted);
  line-height: 1.55;
}

/* —— Footer —— */
.lh-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 1rem 0;
  background: #fff;
  border-top: 1px solid #eef2f7;
  color: #8a96a3;
  font-size: 0.875rem;
  line-height: 1.5;
}

.lh-footer .lh-wrap {
  text-align: center;
}

/* —— Auth pages (login / register) —— */
.lh-auth-main {
  flex: 1 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  padding: 2.5rem 0 3.5rem;
  overflow: hidden;
}

.lh-auth-dots {
  position: absolute;
  width: 180px;
  height: 180px;
  background-image: radial-gradient(circle, rgba(148, 163, 184, 0.45) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  pointer-events: none;
  z-index: 0;
}

.lh-auth-dots--tr {
  top: 8%;
  right: 6%;
}

.lh-auth-dots--bl {
  bottom: 10%;
  left: 5%;
}

.lh-auth-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 3rem;
  align-items: center;
  width: min(100% - 2.5rem, var(--lh-max));
  margin-inline: auto;
}

.lh-auth-copy__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--lh-blue-pill);
  color: var(--lh-blue-deep);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.lh-auth-copy__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--lh-ink);
  letter-spacing: -0.02em;
}

.lh-auth-copy__sub {
  margin: 0 0 0.85rem;
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  font-weight: 600;
  color: var(--lh-text);
}

.lh-auth-copy__text {
  margin: 0;
  max-width: 28rem;
  font-size: 0.975rem;
  color: var(--lh-muted);
  line-height: 1.65;
}

.lh-auth-copy [data-auth-copy] {
  display: none;
}

.lh-auth-copy [data-auth-copy].is-active {
  display: block;
}

.lh-auth-card {
  background: #fff;
  border: 1px solid rgba(215, 228, 242, 0.95);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(30, 90, 160, 0.1);
  padding: 1.75rem 1.65rem 1.85rem;
  width: 100%;
  max-width: 440px;
  margin-left: auto;
}

.lh-auth-card--wide {
  max-width: 560px;
}

.lh-auth-card .login-section {
  margin-bottom: 1.35rem;
}

.lh-auth-card .login-section__title {
  margin: 0 0 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #e6eef6;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3d4f63;
}

.lh-auth-card .login-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.lh-auth-card .login-grid:has(> .login-field:nth-child(2).login-field--hidden) > .login-field:first-child,
.lh-auth-card .login-grid:has(> .login-field:first-child.login-field--hidden) > .login-field:nth-child(2) {
  grid-column: 1 / -1;
}

.lh-auth-card .login-panel {
  display: none;
}

.lh-auth-card .login-panel.is-active {
  display: block;
}

.lh-auth-card .login-field {
  margin-bottom: 1rem;
}

.lh-auth-card .login-label {
  display: inline-block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #566a7f;
}

.lh-auth-card .login-input,
.lh-auth-card .login-select {
  width: 100%;
  display: block;
  padding: 0.6rem 0.9rem;
  font: inherit;
  font-size: 0.9375rem;
  color: #566a7f;
  background: #fff;
  border: 1px solid #d9e6f2;
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.lh-auth-card .login-input:focus,
.lh-auth-card .login-select:focus {
  outline: 0;
  background: #fff;
  border-color: #2c8cff;
  box-shadow: 0 0 0 0.2rem rgba(44, 140, 255, 0.15);
}

.lh-auth-card .login-input-group {
  display: flex;
  align-items: stretch;
}

.lh-auth-card .login-input-group .login-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
}

.lh-auth-card .login-pw-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.875rem;
  background: #f4f8fc;
  border: 1px solid #d9e6f2;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  color: #697a8d;
  cursor: pointer;
}

.lh-auth-card .login-pw-toggle:hover {
  color: #2c8cff;
}

.lh-auth-card .login-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
  flex-wrap: wrap;
}

.lh-auth-card .login-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: #697a8d;
}

.lh-auth-card .login-check input {
  width: 1.1em;
  height: 1.1em;
  margin: 0;
  accent-color: #2c8cff;
}

.lh-auth-card .login-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #2c8cff 0%, #22cee9 100%);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(44, 140, 255, 0.28);
}

.lh-auth-card .login-btn:hover {
  filter: brightness(1.03);
}

.lh-auth-card .login-btn:active {
  transform: translateY(1px);
}

.lh-auth-card .login-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.lh-auth-card .login-link-row {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #697a8d;
}

.lh-auth-card .login-link-row button {
  border: 0;
  background: none;
  padding: 0;
  color: #2c8cff;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.lh-auth-card .login-field--hidden {
  display: none !important;
}

.lh-auth-card .login-field-hint {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #8592a3;
}

.lh-auth-card .login-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.lh-auth-card .login-alert--error {
  color: #991b1b;
  background: linear-gradient(135deg, #fef2f2 0%, #fff7f7 100%);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.lh-auth-card .login-alert--success {
  color: #065f46;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.lh-auth-card .login-alert__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
}

.lh-auth-card .login-alert--error .login-alert__icon {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.lh-auth-card .login-alert--success .login-alert__icon {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.lh-auth-card .login-alert__icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.lh-auth-card .login-alert__text {
  flex: 1;
  min-width: 0;
  padding-top: 0.2rem;
  font-weight: 500;
}

@media (max-width: 960px) {
  .lh-auth-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .lh-auth-copy {
    text-align: center;
  }

  .lh-auth-copy__text {
    margin-inline: auto;
  }

  .lh-auth-card {
    margin-inline: auto;
  }

  .lh-auth-dots {
    opacity: 0.5;
  }
}

@media (max-width: 575.98px) {
  .lh-auth-main {
    padding: 1.5rem 0 2.5rem;
  }

  .lh-auth-card {
    padding: 1.35rem 1.1rem 1.5rem;
  }

  .lh-auth-card .login-grid {
    grid-template-columns: 1fr;
  }
}

/* —— Responsive —— */
@media (max-width: 960px) {
  .lh-hero {
    min-height: 0;
    padding: 3rem 0 2.75rem;
  }

  .lh-hero__media img {
    object-position: center 35%;
  }

  .lh-hero__media::after {
    background:
      linear-gradient(
        180deg,
        rgba(247, 251, 255, 0.2) 0%,
        rgba(247, 251, 255, 0.55) 35%,
        rgba(247, 251, 255, 0.92) 62%,
        #f7fbff 100%
      );
  }

  .lh-hero__content {
    justify-content: center;
  }

  .lh-hero__copy {
    text-align: center;
    width: min(100%, 32rem);
  }

  .lh-hero__text {
    margin-inline: auto;
  }

  .lh-hero__actions {
    justify-content: center;
  }

  .lh-features__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .lh-brand__logo {
    height: 42px;
  }

  .lh-nav-toggle {
    display: inline-block;
  }

  .lh-nav-wrap {
    margin-left: 0;
  }

  .lh-nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 1.25rem;
    left: 1.25rem;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--lh-line);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: var(--lh-shadow);
    z-index: 30;
  }

  .lh-nav.is-open {
    display: flex;
  }

  .lh-header {
    position: relative;
  }

  .lh-header__inner {
    min-height: 3.5rem;
  }

  .lh-features__grid {
    grid-template-columns: 1fr;
  }

  .lh-app__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .lh-app__grid .lh-book:nth-child(n + 7) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lh-hero__copy,
  .lh-card {
    animation: none !important;
    transition: none !important;
  }
}
