/* ==========================================================================
   White Chalk - Main Stylesheet (Modern, Elevated Scale & Responsive)
   ========================================================================== */

:root {
  --green: #184c3a;
  --green-2: #246651;
  --green-light: #e9f3ef;
  --dark: #102c21;
  --mint: #e9f3ef;
  --cream: #f8f6ef;
  --gold: #e9b858;
  --gold-dark: #b37e1a;
  --ink: #17211d;
  --muted: #57655f;
  --line: #e1e7e3;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(20, 65, 49, 0.09);
  --shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.06);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* RTL & Multilingual Typography */
html[dir="rtl"] body {
  font-family: "Noto Kufi Arabic", var(--font-sans);
}
html[lang="hi"] body {
  font-family: "Noto Sans Devanagari", var(--font-sans);
}
html[lang="ml"] body {
  font-family: "Noto Sans Malayalam", var(--font-sans);
}
html[lang="ta"] body {
  font-family: "Noto Sans Tamil", var(--font-sans);
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select, textarea {
  font: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

svg {
  display: block;
}

.container {
  width: min(1320px, calc(100% - 48px));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Announcement Bar
   ========================================================================== */
.announcement {
  background: var(--dark);
  color: #dce9e4;
  font-size: 13.5px;
  font-weight: 500;
}

.announcement-inner {
  min-height: 42px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.announcement p {
  display: flex;
  align-items: center;
  gap: 8px;
}

.announcement p span:first-child {
  color: #70c29e;
  font-size: 11px;
}

.announcement a {
  font-weight: 700;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* ==========================================================================
   Site Header & Navigation
   ========================================================================== */
.site-header {
  height: 88px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.navbar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: linear-gradient(145deg, #1d5a44, var(--green));
  color: #fff;
  font: 700 26px Georgia, serif;
  box-shadow: 0 4px 14px rgba(16, 44, 33, 0.16);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand-tagline {
  margin-top: 3px;
  color: var(--green);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-inline-start: auto;
}

.nav-links a {
  position: relative;
  color: #3b4742;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 0;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  height: 2px;
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  background: var(--green);
  transition: right 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--green);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  right: 0;
}

.nav-links .mobile-account-action {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* Language Switcher */
.language-select {
  position: relative;
}

.language-trigger {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.language-trigger:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-sm);
}

.nav-icon {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.nav-icon.chevron {
  width: 14px;
  height: 14px;
}

.language-menu {
  width: 200px;
  display: none;
  position: absolute;
  top: 54px;
  inset-inline-end: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.13);
  z-index: 120;
}

.language-menu.open {
  display: block;
  animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.language-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: start;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.language-option:hover,
.language-option.active {
  background: var(--mint);
  color: var(--green);
  font-weight: 700;
}

.language-option span {
  width: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

/* User Pill / Sign In Buttons */
.user-chip-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 6px;
  border-radius: 30px;
  background: var(--mint);
  border: 1px solid #d2e4dc;
  color: var(--green);
  font-size: 13.5px;
  font-weight: 700;
  transition: 0.2s ease;
}

.user-chip-button:hover {
  background: #d8ecdf;
  border-color: var(--green);
}

.user-avatar-initial {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13.5px;
  font-weight: 800;
}

.user-name-text {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sign-in {
  min-height: 46px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--green);
  border-radius: 12px;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
  transition: 0.2s ease;
}

.sign-in:hover {
  background: var(--green);
  color: #fff;
}

.logout-form {
  display: flex;
}

.logout-btn {
  background: #fff;
  border-color: #d1dcd6;
  color: var(--muted);
  cursor: pointer;
}

.logout-btn:hover {
  border-color: #b94a48;
  color: #b94a48;
  background: #fff;
}

.mobile-menu {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--green);
  cursor: pointer;
}

.mobile-menu svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */
.message-container {
  margin-top: 24px;
  margin-bottom: -6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 22px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.alert-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  padding: 4px;
  transition: opacity 0.2s;
}

.alert-close:hover {
  opacity: 1;
}

.alert-success {
  background: #eef8f2;
  color: #19633e;
  border: 1px solid #b6e2cb;
}

.alert-error {
  background: #fdf2f2;
  color: #9b2323;
  border: 1px solid #f8b4b4;
}

.alert-info, .alert-warning {
  background: #fdf8eb;
  color: #8f6515;
  border: 1px solid #f6e0ad;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  min-height: 750px;
  position: relative;
  overflow: hidden;
  background: var(--cream);
}

.hero-decoration {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-decoration.one {
  width: 400px;
  height: 400px;
  right: -90px;
  top: 20px;
  background: #dfece6;
  filter: blur(6px);
}

.hero-decoration.two {
  width: 240px;
  height: 240px;
  left: -70px;
  bottom: 60px;
  background: #f2e8d2;
  filter: blur(6px);
}

.hero-grid {
  min-height: 650px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: 64px;
  position: relative;
  z-index: 2;
  padding: 50px 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow i {
  width: 20px;
  height: 2px;
  background: var(--green);
}

.hero h1 {
  max-width: 720px;
  margin: 18px 0 22px;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.hero h1 em {
  color: var(--green);
  font-style: normal;
}

.hero-copy > p {
  max-width: 640px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-search {
  max-width: 660px;
  min-height: 68px;
  margin-top: 32px;
  padding: 10px 10px 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #dfe5e1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(26, 62, 48, 0.08);
}

html[dir="rtl"] .hero-search {
  padding: 10px 20px 10px 10px;
}

.search-icon svg {
  width: 24px;
  height: 24px;
  stroke: #7b8681;
  stroke-width: 2;
  fill: none;
}

.hero-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 16px;
  background: transparent;
}

.hero-search button {
  height: 52px;
  padding: 0 30px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.2s ease;
}

.hero-search button:hover {
  background: var(--green-2);
}

.trust-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
}

.avatars {
  display: flex;
}

.avatars span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-inline-start: -8px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  background: #d8e5df;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.avatars span:first-child {
  margin-inline-start: 0;
}

.stars {
  color: #d99c2c;
  font-size: 14px;
  letter-spacing: 2px;
}

.trust-row p {
  color: var(--muted);
  font-size: 14px;
}

.trust-row strong {
  color: var(--ink);
}

/* Hero Showcase Visuals */
.hero-showcase {
  height: 480px;
  position: relative;
}

.showcase-glow {
  width: 400px;
  height: 400px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #d9e8e1;
}

.document {
  width: 290px;
  height: 375px;
  position: absolute;
  padding: 26px;
  border-radius: 16px;
  box-shadow: 0 30px 70px rgba(15, 52, 38, 0.22);
  color: #fff;
}

.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.doc-head b {
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--dark);
  font-size: 11.5px;
}

.document-back {
  right: 15px;
  top: 25px;
  transform: rotate(8deg);
  background: #bed3c9;
  color: var(--green);
}

.document-back .doc-head b {
  background: #fff;
}

.history-symbol {
  margin: 64px 0 18px;
  font-size: 48px;
}

.document h3 {
  font: 700 26px Georgia, serif;
}

.document p {
  font-size: 13.5px;
  opacity: 0.88;
  margin-top: 5px;
}

.document-front {
  left: 20px;
  top: 55px;
  z-index: 2;
  transform: rotate(-3deg);
  background: var(--green);
}

.math-symbol {
  margin: 44px 0 18px;
  font: 58px/1 Georgia, serif;
}

.doc-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 26px;
}

.doc-lines i {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

.doc-lines i:nth-child(2) { width: 78%; }
.doc-lines i:nth-child(3) { width: 55%; }

.floating-card {
  position: absolute;
  z-index: 4;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e6ebe8;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.floating-card > b {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--mint);
  color: var(--green);
}

.floating-card svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.floating-card span {
  display: flex;
  flex-direction: column;
}

.floating-card strong {
  font-size: 13.5px;
  color: var(--ink);
}

.floating-card small {
  color: var(--muted);
  font-size: 11.5px;
}

.verified {
  top: 25px;
  left: -10px;
}

.download {
  right: -10px;
  bottom: 20px;
}

/* Stats Bar */
.stats-bar {
  min-height: 110px;
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  padding: 0 44px;
  margin-bottom: 24px;
  border: 1px solid #e0e6e2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(20, 63, 47, 0.08);
}

.stats-bar div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.stats-bar strong {
  font-size: 30px;
  font-weight: 800;
  color: var(--green);
}

.stats-bar span {
  max-width: 105px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
}

.stats-bar > i {
  width: 1px;
  height: 40px;
  background: var(--line);
}

/* ==========================================================================
   Sections & Headings
   ========================================================================== */
.section {
  padding: 92px 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.section-label {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-heading h2,
.center-heading h2,
.global-banner h2 {
  margin-top: 8px;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.section-heading p,
.center-heading p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
}

.section-heading > a {
  color: var(--green);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.section-heading > a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Subject Cards
   ========================================================================== */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.dynamic-subject-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.subject-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition: 0.22s ease;
}

.subject-card:hover {
  transform: translateY(-4px);
  border-color: #b8d0c5;
  box-shadow: var(--shadow);
}

.subject-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.subject-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.subject-icon.math { background: #e7f2ed; color: #2e7359; }
.subject-icon.language { background: #f6ede1; color: #a96829; }
.subject-icon.science { background: #e8edf4; color: #456886; }
.subject-icon.history { background: #f1e8ee; color: #7c4e69; }

.subject-card > span:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.subject-card strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.subject-card small {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 3px;
}

.subject-card > b {
  color: #9ca7a2;
}

.subject-card > b svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

html[dir="rtl"] .subject-card > b svg {
  transform: rotate(180deg);
}

/* ==========================================================================
   Product Cards & Grid
   ========================================================================== */
.products-section {
  background: #f8faf9;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}

.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.product-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-cover {
  height: 250px;
  padding: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  overflow: hidden;
}

.product-cover::after {
  content: "";
  position: absolute;
  inset: 20% 0 0;
  background: linear-gradient(transparent, rgba(7, 24, 17, 0.55));
}

.product-cover > * {
  position: relative;
  z-index: 1;
}

.product-cover > small {
  margin-bottom: auto;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  font-weight: 700;
  opacity: 0.9;
}

.cover-symbol {
  margin-bottom: 16px;
  font: 40px/1 Georgia, serif;
  font-weight: 700;
}

.product-cover > strong {
  font: 700 22px Georgia, serif;
  line-height: 1.2;
}

.product-cover > p,
.product-cover > span {
  font-size: 12.5px;
  opacity: 0.9;
  margin-top: 4px;
}

.cover-green { background: #245b47; }
.cover-orange { background: #c77d40; }
.cover-purple { background: #74445e; }
.cover-blue { background: #365776; }

.resource-cover-image {
  padding: 0;
  background: var(--mint);
}

.resource-cover-image::after {
  display: none;
}

.resource-cover-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: static;
  z-index: auto;
}

.product-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--dark);
  font-size: 12px !important;
  font-weight: 800;
  opacity: 1 !important;
  z-index: 2;
}

.product-info {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-category {
  color: var(--green);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #c58b20;
  font-weight: 800;
  font-size: 13.5px;
}

.star-gold {
  color: #d99c2c;
  font-size: 15px;
}

.product-info h3 {
  margin: 10px 0 8px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--ink);
}

.card-description {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-info footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.product-info footer strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.free-tag, .free-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 7px;
  background: var(--mint);
  color: var(--green);
  font-size: 13.5px;
  font-weight: 800;
}

.card-arrow {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--mint);
  color: var(--green);
  transition: 0.2s ease;
}

.card-arrow svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.product-card:hover .card-arrow {
  background: var(--green);
  color: #fff;
}

/* ==========================================================================
   How It Works (Steps)
   ========================================================================== */
.center-heading {
  text-align: center;
}

.center-heading p {
  margin-inline: auto;
  max-width: 640px;
}

.steps {
  max-width: 1080px;
  margin: 56px auto 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.steps > div {
  position: relative;
  padding: 22px;
}

.steps > div > span {
  position: absolute;
  left: 50%;
  top: -24px;
  transform: translateX(-50%);
  color: #edf2ef;
  font-size: 76px;
  font-weight: 800;
  z-index: -1;
}

.steps > div > b {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--mint);
  color: var(--green);
}

.steps > div > b svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.steps h3 {
  font-size: 18px;
  font-weight: 800;
}

.steps p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.steps > i svg {
  width: 24px;
  height: 24px;
  stroke: #aab4af;
  stroke-width: 2;
  fill: none;
}

html[dir="rtl"] .steps > i svg {
  transform: rotate(180deg);
}

/* ==========================================================================
   Global Banner CTA
   ========================================================================== */
.global-banner {
  margin-top: 24px;
  margin-bottom: 96px;
  padding: 56px 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 44px;
  border-radius: 24px;
  background: var(--green);
  color: #fff;
  overflow: hidden;
  position: relative;
}

.global-banner::after {
  content: "";
  width: 280px;
  height: 280px;
  position: absolute;
  right: -70px;
  top: -100px;
  border: 50px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.global-banner > div {
  position: relative;
  z-index: 2;
}

.global-banner .section-label {
  color: #acd2c0;
}

.global-banner h2 {
  max-width: 740px;
  font-size: clamp(26px, 3.2vw, 38px);
}

.global-banner p {
  max-width: 660px;
  margin-top: 12px;
  color: #c6d8d0;
  font-size: 16px;
  line-height: 1.6;
}

.global-banner > a {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  padding: 16px 30px;
  border-radius: 12px;
  background: #fff;
  color: var(--green);
  font-size: 15px;
  font-weight: 800;
  transition: 0.2s ease;
}

.global-banner > a:hover {
  background: #e9f3ef;
}

/* ==========================================================================
   Catalog Page & Advanced Filters
   ========================================================================== */
.page-hero {
  padding: 70px 0;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  margin-top: 10px;
  font-size: clamp(34px, 4.8vw, 58px);
  line-height: 1.12;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.page-hero p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 17px;
}

.personal-hero {
  background: var(--mint);
}

.legal-hero {
  background: #fbf9f4;
}

.catalog-section {
  padding-top: 50px;
  padding-bottom: 96px;
}

.advanced-filter-form {
  margin-bottom: 34px;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(20, 65, 49, 0.06);
}

.filter-main-bar {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.filter-search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafcfb;
}

.search-icon-svg {
  width: 22px;
  height: 22px;
  stroke: var(--muted);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.filter-search-box input {
  width: 100%;
  height: 52px;
  border: none;
  background: transparent;
  font-size: 15.5px;
  outline: none;
  color: var(--ink);
}

.filter-submit-btn {
  padding: 0 28px;
  height: 52px;
  font-size: 14.5px;
  font-weight: 800;
  border-radius: 14px;
  gap: 9px;
}

.filter-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.filter-select-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 7px;
}

.filter-select-group select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.filter-select-group select:focus {
  border-color: var(--green);
}

.active-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  font-size: 13.5px;
  color: var(--muted);
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 9px;
  background: var(--mint);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.clear-all-link {
  margin-inline-start: auto;
  font-weight: 800;
  color: #c53030;
  font-size: 13.5px;
}

.clear-all-link:hover {
  text-decoration: underline;
}

.catalog-meta {
  margin: 26px 0 20px;
  color: var(--muted);
  font-size: 15px;
}

.catalog-meta strong {
  color: var(--ink);
}

.catalog-grid {
  grid-template-columns: repeat(4, 1fr);
}

.primary-button {
  min-height: 48px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
  white-space: nowrap;
}

.primary-button svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.primary-button:hover {
  background: var(--green-2);
}

.secondary-action-link {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--muted);
  transition: color 0.2s;
}

.secondary-action-link:hover {
  color: var(--ink);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 50px;
}

.pagination a {
  min-height: 46px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
  background: #fff;
  transition: 0.2s;
}

.pagination a:hover {
  border-color: var(--green);
  background: var(--mint);
}

.pagination span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.empty-state {
  min-height: 310px;
  padding: 52px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cdd9d3;
  border-radius: 20px;
  background: #fafcfb;
  text-align: center;
}

.empty-state > span {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 18px;
  background: var(--mint);
  color: var(--green);
}

.empty-state > span svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.empty-state h3 {
  font-size: 22px;
  font-weight: 800;
}

.empty-state p {
  max-width: 480px;
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 14.5px;
}

/* ==========================================================================
   Resource Detail Page
   ========================================================================== */
.detail-section {
  padding-top: 45px;
  padding-bottom: 96px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 30px;
  color: var(--green);
  font-size: 14.5px;
  font-weight: 800;
}

.back-link svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.75fr) minmax(0, 1.25fr);
  gap: 64px;
  align-items: start;
}

.detail-cover {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(16, 44, 33, 0.15);
}

.detail-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-cover-placeholder {
  height: 100%;
  padding: 44px;
  display: flex;
  flex-direction: column;
  background: var(--green);
  color: #fff;
}

.detail-cover-placeholder small {
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.detail-cover-placeholder b {
  width: 84px;
  height: 84px;
  margin: auto;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold);
  font: 800 24px var(--font-sans);
}

.detail-cover-placeholder strong {
  font: 700 clamp(26px, 3.2vw, 38px) Georgia, serif;
}

.detail-cover-placeholder span {
  color: #b8d1c5;
  font-size: 13.5px;
  margin-top: 5px;
}

.detail-copy {
  padding-top: 8px;
}

.detail-top-badges {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.resource-pill {
  display: inline-flex;
  padding: 7px 14px;
  border-radius: 9px;
  background: var(--mint);
  color: var(--green);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.rating-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9px;
  background: #fef7e9;
  border: 1px solid #f6e2b8;
  color: #a87315;
  font-size: 13.5px;
  font-weight: 800;
}

.detail-copy h1 {
  max-width: 760px;
  margin: 14px 0 18px;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.detail-lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 17.5px;
  line-height: 1.7;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 30px 0;
}

.detail-facts div {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.detail-facts span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}

.detail-facts strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  font-weight: 800;
}

.detail-price {
  font-size: 36px;
  font-weight: 800;
  margin: 20px 0;
}

.detail-price small {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.access-panel {
  max-width: 580px;
  margin: 26px 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fafcfb;
}

.wide-button {
  width: 100%;
  min-height: 52px;
  font-size: 15.5px;
  font-weight: 800;
  border-radius: 12px;
}

.muted-button {
  background: #94a39d;
  cursor: not-allowed;
}

.muted-button:hover {
  background: #94a39d;
}

.access-note {
  margin-top: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13.5px;
}

.success-note {
  color: var(--green);
  font-weight: 700;
}

.admin-contact-box {
  margin-top: 20px;
  padding: 22px 24px;
  border: 1px solid #d3e2db;
  border-radius: 16px;
  background: #f4f9f6;
}

.admin-contact-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  color: var(--green);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-contact-header svg {
  width: 20px;
  height: 20px;
}

.admin-contact-desc {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.admin-contact-buttons {
  display: flex;
  gap: 14px;
}

.btn-contact-telegram {
  flex: 1;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border-radius: 12px;
  background: #24a1de;
  color: #fff !important;
  font-size: 14.5px;
  font-weight: 700;
  transition: 0.2s ease;
  box-shadow: 0 4px 14px rgba(36, 161, 222, 0.22);
}

.btn-contact-telegram:hover {
  background: #1b8ec5;
}

.btn-contact-phone {
  flex: 1;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #c2d8cd;
  color: var(--green) !important;
  font-size: 14.5px;
  font-weight: 700;
  transition: 0.2s ease;
}

.btn-contact-phone:hover {
  background: #eef6f2;
  border-color: var(--green);
}

.btn-contact-telegram svg,
.btn-contact-phone svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.detail-description {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.detail-description h2 {
  margin-bottom: 14px;
  font-size: 24px;
  font-weight: 800;
}

.detail-description p {
  max-width: 760px;
  color: #3d4c46;
  font-size: 16px;
  line-height: 1.85;
}

/* ==========================================================================
   Reviews & Ratings Section
   ========================================================================== */
.reviews-section {
  margin-top: 64px;
  padding-top: 50px;
  border-top: 1px solid var(--line);
}

.reviews-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 38px;
}

.reviews-header h2 {
  font-size: clamp(24px, 3.2vw, 32px);
  letter-spacing: -0.03em;
  font-weight: 800;
}

.reviews-header p {
  color: var(--muted);
  font-size: 15.5px;
  margin-top: 5px;
}

.reviews-summary-score {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 28px;
  border-radius: 18px;
  background: var(--cream);
  border: 1px solid #ebdcc5;
}

.big-score {
  font-size: 44px;
  font-weight: 800;
  color: #b37e1a;
  line-height: 1;
}

.stars-display {
  display: flex;
  gap: 3px;
  color: #d1dcd6;
  font-size: 20px;
}

.stars-display .star.filled {
  color: #d99c2c;
}

.reviews-summary-score small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13.5px;
}

.reviews-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 48px;
  align-items: start;
}

.review-form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

.review-form-card h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}

.review-form-actions {
  margin-top: 18px;
}

.delete-review-form {
  margin-top: 16px;
  text-align: center;
}

.delete-review-button {
  background: none;
  border: none;
  color: #c53030;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.login-prompt-box {
  text-align: center;
  padding: 28px 20px;
  background: #fafcfb;
  border-radius: 14px;
  border: 1px dashed var(--line);
}

.login-prompt-box p {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 18px;
}

.reviews-list-container {
  min-height: 220px;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.review-item {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.review-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.review-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-avatar-small {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green);
  font-weight: 800;
  font-size: 15px;
  display: grid;
  place-items: center;
}

.review-user-info strong {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
}

.review-user-info small {
  color: var(--muted);
  font-size: 12.5px;
}

.review-text {
  font-size: 15px;
  color: #3d4c46;
  line-height: 1.7;
}

.empty-reviews-state {
  text-align: center;
  padding: 48px 22px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: #fafcfb;
}

.empty-reviews-state span {
  font-size: 40px;
  color: #d99c2c;
  display: block;
  margin-bottom: 12px;
}

.empty-reviews-state h4 {
  font-size: 18px;
  font-weight: 800;
}

.empty-reviews-state p {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 5px;
}

/* ==========================================================================
   Personal Library (My Resources)
   ========================================================================== */
.library-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.library-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 26px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  align-items: center;
}

.library-cover {
  height: 190px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
}

.library-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-cover span {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--gold);
  font-weight: 800;
  font-size: 18px;
}

.library-card > div {
  min-width: 0;
}

.library-card h2 {
  margin: 6px 0 10px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 800;
}

.library-card p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================================================
   Profile & Change Password Forms
   ========================================================================== */
.profile-section {
  padding-top: 52px;
  padding-bottom: 96px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 40px;
  align-items: start;
}

.profile-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 30px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.profile-avatar-large {
  width: 90px;
  height: 90px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-2), var(--green));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(24, 76, 58, 0.22);
}

.profile-card h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.profile-email-badge {
  display: inline-block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14.5px;
}

.profile-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-stat-box strong {
  display: block;
  font-size: 26px;
  color: var(--green);
  font-weight: 800;
}

.profile-stat-box span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.profile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: start;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  transition: 0.2s ease;
}

.profile-menu-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.profile-menu-item:hover,
.profile-menu-item.active {
  background: var(--mint);
  color: var(--green);
}

.profile-content-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 38px 44px;
  box-shadow: var(--shadow-sm);
}

.profile-card-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.profile-card-header h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.profile-card-header p {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 5px;
}

.custom-form .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--ink);
}

.form-input, .form-select, .form-textarea,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group textarea {
  min-height: 110px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(24, 76, 58, 0.12);
}

.form-hint {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  color: var(--muted);
}

.field-error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #c53030;
}

.form-error-banner {
  padding: 14px 18px;
  background: #fdf2f2;
  border: 1px solid #f8b4b4;
  border-radius: 12px;
  color: #9b2323;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 22px;
}

.form-actions-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  padding-top: 75px;
  background: var(--dark);
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 56px;
  padding-bottom: 54px;
}

.brand-mark.light {
  background: #fff;
  color: var(--green);
}

.footer-intro > p {
  max-width: 320px;
  margin: 18px 0;
  color: #aabdb4;
  font-size: 14.5px;
  line-height: 1.65;
}

.socials {
  display: flex;
  gap: 12px;
}

.socials a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #b9c8c1;
  transition: 0.2s ease;
}

.socials a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.socials svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.footer-grid > div:not(:first-child) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.footer-grid h3 {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}

.footer-grid > div > a,
.footer-grid > div > p {
  color: #9fb1a9;
  font-size: 14.5px;
  transition: color 0.2s;
}

.footer-grid > div > a:hover {
  color: #fff;
}

.newsletter {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  overflow: hidden;
}

.newsletter input {
  width: 100%;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 14.5px;
}

.newsletter button {
  width: 48px;
  border: 0;
  background: #fff;
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.footer-bottom {
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #8da398;
  font-size: 13.5px;
}

.footer-bottom a {
  color: inherit;
}

.footer-bottom a:hover {
  color: #fff;
}

/* ==========================================================================
   Legal & Static Pages
   ========================================================================== */
.legal-section {
  padding-top: 45px;
  padding-bottom: 96px;
}

.legal-meta {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 14.5px;
}

.legal-content h2 {
  margin: 36px 0 12px;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.legal-content h2:first-of-type {
  margin-top: 0;
}

.legal-content p {
  color: #3d4c46;
  font-size: 15.5px;
  line-height: 1.85;
  margin-bottom: 18px;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (Mobile-First Polish)
   ========================================================================== */

/* Tablet & Smaller Laptops (<= 1080px) */
@media (max-width: 1080px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 88px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    padding: 26px 30px;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
    z-index: 90;
  }

  .nav-links.open {
    display: flex;
    animation: dropdownFadeIn 0.2s ease;
  }

  .nav-links a {
    width: 100%;
    padding: 10px 0;
    font-size: 16px;
    border-bottom: 1px solid #f3f7f5;
  }

  .nav-links .mobile-account-action {
    display: block;
    width: 100%;
    margin-top: 10px;
  }

  .nav-links form.mobile-account-action button {
    width: 100%;
    padding: 12px 0;
    border: 0;
    background: transparent;
    color: #c53030;
    font-size: 16px;
    font-weight: 700;
    text-align: start;
    cursor: pointer;
  }

  .mobile-menu {
    display: grid;
    place-items: center;
  }

  .nav-actions > .sign-in {
    display: none;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    padding-top: 45px;
    text-align: center;
  }

  .hero-copy > p,
  .hero-search {
    margin-inline: auto;
  }

  .eyebrow,
  .trust-row {
    justify-content: center;
  }

  .hero-showcase {
    width: min(540px, 100%);
    margin: 14px auto 0;
  }

  .product-grid,
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .detail-cover {
    width: min(100%, 440px);
    margin: 0 auto;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  .container {
    width: min(100% - 32px, 1320px);
  }

  .announcement {
    display: none;
  }

  .site-header {
    height: 78px;
  }

  .nav-links {
    top: 78px;
    max-height: calc(100vh - 78px);
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    font-size: 23px;
    border-radius: 11px;
  }

  .brand-name {
    font-size: 19px;
  }

  .brand-tagline {
    font-size: 9.5px;
  }

  .language-trigger {
    height: 42px;
    padding: 0 12px;
    font-size: 12.5px;
  }

  .language-trigger .globe,
  .language-trigger .chevron {
    display: none;
  }

  .user-chip-button {
    padding: 4px 10px 4px 4px;
  }

  .user-name-text {
    max-width: 100px;
    font-size: 12.5px;
  }

  .logout-form {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .hero-grid {
    min-height: auto;
    padding: 44px 0 24px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-copy > p {
    font-size: 16px;
  }

  .hero-search {
    min-height: auto;
    flex-direction: column;
    padding: 12px;
  }

  .hero-search input {
    height: 48px;
    font-size: 15px;
  }

  .hero-search button {
    width: 100%;
    height: 48px;
    font-size: 15px;
  }

  .hero-showcase {
    height: 400px;
    max-width: 100%;
    overflow: hidden;
  }

  .document {
    width: 250px;
    height: 320px;
    padding: 22px;
  }

  .document-front { left: 10px; }
  .document-back { right: 10px; }
  .document h3 { font-size: 22px; }

  .stats-bar {
    min-height: auto;
    grid-template-columns: 1fr 1fr;
    padding: 24px;
    gap: 18px;
  }

  .stats-bar div {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .stats-bar > i {
    display: none;
  }

  .stats-bar strong {
    font-size: 26px;
  }

  .stats-bar span {
    max-width: none;
    font-size: 13.5px;
  }

  .section {
    padding: 68px 0;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .steps > i {
    display: none;
  }

  .global-banner {
    margin-bottom: 68px;
    padding: 40px 28px;
    flex-direction: column;
    align-items: flex-start;
  }

  .advanced-filter-form {
    padding: 20px 18px;
  }

  .filter-main-bar {
    flex-direction: column;
  }

  .filter-options-grid {
    grid-template-columns: 1fr;
  }

  .custom-form .form-row-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .reviews-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .reviews-summary-score {
    width: 100%;
    justify-content: center;
  }

  .library-grid {
    grid-template-columns: 1fr;
  }

  .library-card {
    grid-template-columns: 120px 1fr;
    gap: 18px;
  }

  .library-cover {
    height: 150px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* Small Screen Phones (<= 480px) */
@media (max-width: 480px) {
  .container {
    width: calc(100% - 24px);
  }

  .brand-copy {
    display: none;
  }

  .product-grid,
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .product-cover {
    height: 260px;
  }

  .subject-grid {
    grid-template-columns: 1fr;
  }

  .detail-facts {
    grid-template-columns: 1fr 1fr;
  }

  .admin-contact-buttons {
    flex-direction: column;
  }

  .profile-content-card {
    padding: 26px 20px;
  }

  .library-card {
    grid-template-columns: 1fr;
  }

  .library-cover {
    height: 220px;
  }

  .pagination {
    gap: 12px;
    flex-wrap: wrap;
  }

  .pagination a {
    padding: 0 14px;
    font-size: 12.5px;
  }
}

/* Micro-screen optimization (<= 360px) */
@media (max-width: 360px) {
  .hero h1 {
    font-size: 32px;
  }

  .stats-bar {
    grid-template-columns: 1fr;
  }

  .detail-facts {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
