* {
  box-sizing: border-box;
}

:root {
  --accent: #f59e0b;
  --bg-main: #f8fafc;
  --font-body: "Almarai", sans-serif;
  --font-head: "IBM Plex Sans Arabic", sans-serif;
  --primary-blue: #1e293b;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --danger: #b91c1c;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
  background: #eef2f7;
  color: var(--primary-blue);
  font-family: var(--font-body);
}

.page {
  display: grid;
  gap: 96px;
  padding: 48px 20px 80px;
  min-height: 100vh;
  min-height: 100svh;
}

.screen {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  background: var(--bg-main);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

.shell,
.shell-wide {
  padding-inline: 120px;
}

.header {
  min-height: 80px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header>* {
  min-width: 0;
}

.menu-toggle,
.mobile-menu {
  display: none;
}

.menu-toggle {
  border: 1px solid var(--slate-200);
  background: #fff;
  border-radius: 10px;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--primary-blue);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header.menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header.menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.header.menu-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.logo {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.logo-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.logo-text {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-blue);
}

.logo-image-header {
  height: 44px;
}

.logo-image-footer {
  height: 52px;
}

.nav {
  display: flex;
  gap: 40px;
  min-width: 0;
}

.nav a {
  color: var(--slate-500);
  text-decoration: none;
  font-size: 16px;
  overflow-wrap: break-word;
}

.hero,
.problem,
.steps,
.subjects,
.faq,
.signup {
  padding-top: 100px;
  padding-bottom: 100px;
}

.hero,
.problem,
.steps,
.faq,
.signup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.badge {
  margin: 0;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 100px;
  padding: 8px 16px;
  color: var(--primary-blue);
  font-size: 14px;
}

h1,
h2,
h3,
strong {
  margin: 0;
  font-family: var(--font-head);
}

h1 {
  max-width: 1000px;
  text-align: center;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.4;
  overflow-wrap: break-word;
}

h2 {
  text-align: center;
  font-size: clamp(30px, 3.6vw, 40px);
  overflow-wrap: break-word;
}

.hero .sub,
.signup>p {
  max-width: 800px;
  margin: 0;
  text-align: center;
  color: var(--slate-500);
  font-size: 20px;
  line-height: 1.8;
  overflow-wrap: break-word;
}

.trust {
  margin: 0;
  color: var(--slate-400);
  font-size: 14px;
  text-align: center;
  overflow-wrap: break-word;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  padding: 20px 48px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

.cta:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.cta-sm {
  font-size: 16px;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: none;
}

.grid {
  width: 100%;
  display: grid;
}

.cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-main);
  border: 1px solid var(--slate-200);
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card h3,
.subject-card h3,
.faq-item h3 {
  font-size: 22px;
  text-align: right;
}

.card p,
.subject-card p,
.faq-item p {
  margin: 0;
  color: var(--slate-500);
  text-align: right;
  line-height: 1.6;
  font-size: 16px;
  overflow-wrap: break-word;
}

.icon {
  color: var(--accent);
  line-height: 1;
  display: inline-flex;
}

.icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 2.2;
}

.steps {
  gap: 64px;
}

.steps-3 {
  grid-template-columns: repeat(3, minmax(0, 250px));
  justify-content: center;
  gap: 80px;
}

.step {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step span {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 48px;
  font-weight: 700;
}

.step strong {
  color: var(--primary-blue);
  font-size: 24px;
}

.subjects {
  background: var(--primary-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

.subjects h2 {
  color: #fff;
}

.subject-card {
  background: var(--slate-800);
  border: 1px solid var(--slate-700);
  border-radius: 24px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.subject-card h3 {
  color: #fff;
}

.subject-card p {
  color: var(--slate-400);
}

.faq {
  gap: 48px;
}

.faq-item {
  width: min(800px, 100%);
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  background: #fff;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.signup {
  padding-top: 120px;
  gap: 40px;
}

.signup h2 {
  max-width: 800px;
}

.signup>p {
  max-width: 600px;
  font-size: 22px;
}

.form {
  width: min(450px, 100%);
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

label {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label span {
  color: var(--slate-500);
  font-size: 16px;
  text-align: right;
}

input {
  width: 100%;
  height: 56px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: #fff;
  padding: 14px 20px;
  text-align: right;
  color: var(--primary-blue);
  font-family: var(--font-body);
  font-size: 16px;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(245, 158, 11, 0.35);
  outline-offset: 2px;
}

.field-error,
.form-feedback {
  margin: -12px 0 0;
  font-size: 14px;
  text-align: right;
  display: none;
}

.field-error {
  color: var(--danger);
}

.field-error:not(:empty),
.form-feedback:not(:empty) {
  display: block;
}

.form-feedback {
  color: var(--slate-500);
}

.form-feedback.error {
  color: var(--danger);
}

.field-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.success-message {
  min-height: 340px;
  justify-content: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.check {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  background: #10b981;
  color: #fff;
  display: grid;
  place-items: center;
}

.check svg {
  width: 40px;
  height: 40px;
  stroke-width: 3;
}

.hidden {
  display: none;
}

.footer {
  background: var(--primary-blue);
  padding-top: 60px;
  padding-bottom: 60px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
}

.footer-tagline,
.footer-copyright {
  margin: 0;
  color: var(--slate-500);
  font-size: 14px;
  text-align: right;
}

.footer-tagline {
  line-height: 1.8;
}

.footer-links {
  display: flex;
  gap: 56px;
  align-items: flex-start;
}

.footer-links-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 160px;
}

.footer-links-group h3 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-family: var(--font-head);
  font-weight: 700;
  text-align: right;
}

.footer-link-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link-list a {
  color: var(--slate-400);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link-list a:hover {
  color: #fff;
}

.footer-link-list a:focus-visible {
  outline-offset: 3px;
}

.footer-logo-text {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.legal-page .page {
  gap: 48px;
}

.legal-header {
  min-height: 88px;
}

.legal-back-link {
  white-space: nowrap;
}

.legal-main {
  padding-top: 64px;
  padding-bottom: 80px;
}

.legal-card {
  width: min(920px, 100%);
  margin: 0 auto;
  border: 1px solid var(--slate-200);
  border-radius: 24px;
  background: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.legal-card h1 {
  max-width: none;
  text-align: right;
  font-size: clamp(30px, 4vw, 42px);
}

.legal-intro {
  margin: 0;
  color: var(--slate-500);
  font-size: 18px;
  line-height: 1.9;
  text-align: right;
}

.legal-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.legal-section {
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  background: var(--bg-main);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legal-section h2 {
  text-align: right;
  font-size: clamp(22px, 2.8vw, 28px);
}

.legal-section p {
  margin: 0;
  color: var(--slate-500);
  font-size: 16px;
  line-height: 1.8;
  text-align: right;
}

.legal-note {
  margin: 0;
  color: var(--slate-400);
  font-size: 14px;
  line-height: 1.8;
  text-align: right;
}

@media (max-width: 1200px) {

  .shell,
  .shell-wide {
    padding-inline: 56px;
  }

  .cards-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps-3 {
    gap: 36px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .page {
    padding: 20px 12px 60px;
    gap: 56px;
  }

  .shell,
  .shell-wide {
    padding-inline: 16px;
  }

  .header {
    position: relative;
    min-height: auto;
    padding-top: 14px;
    padding-bottom: 14px;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .header > .cta-sm,
  .header > .nav {
    display: none;
  }

  .legal-header > .cta-sm {
    display: inline-flex;
  }

  .menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .mobile-menu {
    position: absolute;
    inset-inline: 16px;
    top: calc(100% + 8px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    background: var(--bg-main);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
    max-width: calc(100% - 32px);
    overflow: hidden;
  }

  .mobile-menu[hidden] {
    display: none;
  }

  .mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .mobile-nav a {
    color: var(--slate-500);
    text-decoration: none;
    font-size: 16px;
    width: 100%;
  }

  .mobile-menu-cta {
    width: 100%;
  }

  .logo-image-header {
    height: 38px;
  }

  .logo-image-footer {
    height: 44px;
  }

  .hero,
  .problem,
  .steps,
  .subjects,
  .faq,
  .signup {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .hero .sub,
  .signup>p {
    font-size: 18px;
  }

  .trust {
    line-height: 1.7;
  }

  .cards-3,
  .steps-3 {
    grid-template-columns: 1fr;
  }

  .cta {
    width: 100%;
    padding-inline: 24px;
    text-align: center;
    font-size: 18px;
  }

  .cta-sm {
    max-width: 100%;
    width: auto;
    font-size: 15px;
  }

  .legal-main {
    padding-top: 40px;
    padding-bottom: 56px;
  }

  .legal-card {
    padding: 24px;
    border-radius: 18px;
    gap: 20px;
  }

  .legal-intro {
    font-size: 16px;
  }

  .legal-section {
    padding: 18px;
  }

  .legal-section h2 {
    font-size: 22px;
  }

  .legal-header {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .legal-header .logo-text {
    font-size: 20px;
  }

  .footer {
    gap: 28px;
  }

  .footer-top,
  .footer-links {
    flex-direction: column;
    gap: 24px;
  }

  .footer-links {
    width: 100%;
  }

  .footer-links-group {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 26px;
  }

  .hero .sub,
  .signup>p {
    font-size: 16px;
    line-height: 1.7;
  }

  .card,
  .subject-card,
  .faq-item {
    padding: 24px;
  }

  .logo-image-header {
    height: 34px;
  }

  .logo-image-footer {
    height: 40px;
  }
}
