/* ==========================================================================
   Kutaib (كتيب) Official Website Stylesheet
   Visual Identity:
   - Primary: #057A64
   - Primary Dark: #035243
   - Secondary Light: #E0F2EF
   - Background: #F5F6F9
   - Text Primary: #14151A
   - Text Secondary: #92949C
   - Border: #E3E5EB
   - Arabic Font: 'Almarai', sans-serif
   ========================================================================== */

:root {
  --primary: #057A64;
  --primary-dark: #035243;
  --secondary-light: #E0F2EF;
  --bg-main: #F5F6F9;
  --surface: #FFFFFF;
  --text-main: #14151A;
  --text-secondary: #92949C;
  --text-muted: #5E6068;
  --border-color: #E3E5EB;
  --warning-bg: #FFFBEB;
  --warning-border: #F59E0B;
  --warning-text: #92400E;
  --danger-bg: #FEF2F2;
  --danger-border: #EF4444;
  --danger-text: #991B1B;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(20, 21, 26, 0.04);
  --shadow-md: 0 10px 30px rgba(20, 21, 26, 0.06);
  --shadow-lg: 0 20px 45px rgba(5, 122, 100, 0.12);
  --transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Almarai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

ul {
  list-style: none;
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--text-main);
  font-weight: 800;
  line-height: 1.3;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary-dark);
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text-muted);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background-color: var(--secondary-light);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text-main);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.lang-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--secondary-light);
}

.menu-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-main);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.65rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(5, 122, 100, 0.22);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--primary-dark);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background-color: var(--secondary-light);
}

.btn-sm {
  padding: 0.55rem 1.1rem;
  font-size: 0.92rem;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.95rem;
  background-color: var(--secondary-light);
  color: var(--primary-dark);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 1.1rem;
}

.badge-warning {
  background-color: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Hero Section */
.hero {
  padding: 4.5rem 0 5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 3.5rem;
}

.hero-content h1 {
  margin-bottom: 1.25rem;
}

.hero-content p {
  font-size: 1.15rem;
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Interactive Phone Mockup */
.mockup-wrapper {
  display: flex;
  justify-content: center;
  position: relative;
}

.phone-frame {
  width: 320px;
  background: var(--text-main);
  border-radius: 38px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  border: 4px solid #2A2C35;
}

.phone-screen {
  background: var(--bg-main);
  border-radius: 28px;
  overflow: hidden;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.mock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border-color);
}

.mock-header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--primary-dark);
}

.mock-header-brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.mock-status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  background: var(--secondary-light);
  color: var(--primary-dark);
}

.mock-reader-card {
  background: var(--primary);
  color: #FFFFFF;
  padding: 1.1rem;
  border-radius: 16px;
}

.mock-reader-tag {
  display: inline-block;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.mock-reader-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 0.3rem;
  color: #FFFFFF;
}

.mock-reader-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.88);
}

.mock-book-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mock-book-item {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mock-book-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--secondary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.82rem;
}

.mock-book-info {
  flex: 1;
}

.mock-book-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.mock-book-meta {
  font-size: 0.73rem;
  color: var(--text-secondary);
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-surface {
  background-color: var(--surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}

.section-header h2 {
  margin-bottom: 0.85rem;
}

/* Page Hero (Inner Pages) */
.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  padding: 3.5rem 0;
  text-align: center;
}

.page-header h1 {
  margin-bottom: 0.85rem;
}

.page-header p {
  max-width: 680px;
  margin: 0 auto;
}

/* Grids & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.85rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background-color: var(--secondary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.card h3 {
  margin-bottom: 0.65rem;
}

.card p {
  font-size: 0.98rem;
}

.step-number {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
  font-size: 1.05rem;
}

/* Store Download Section */
.download-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 3.25rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.download-banner h2 {
  color: #FFFFFF;
  margin-bottom: 0.85rem;
}

.download-banner p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 620px;
  margin: 0 auto 2rem;
}

.store-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.store-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 240px;
  text-align: start;
  color: #FFFFFF;
  backdrop-filter: blur(6px);
}

.store-card.disabled {
  cursor: default;
}

.store-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  flex-shrink: 0;
}

.store-info {
  display: flex;
  flex-direction: column;
}

.store-name {
  font-weight: 800;
  font-size: 1.05rem;
}

.store-badge-soon {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  background: #FFFFFF;
  color: var(--primary-dark);
  padding: 0.1rem 0.55rem;
  border-radius: 99px;
  width: fit-content;
}

/* FAQ Accordion */
.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: start;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-question:hover {
  color: var(--primary);
}

.faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.98rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-icon {
  transition: transform 0.25s ease;
  color: var(--primary);
  flex-shrink: 0;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

/* Legal & Content Documents */
.legal-container {
  max-width: 880px;
  margin: 0 auto;
}

.legal-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
}

.legal-card h2 {
  font-size: 1.45rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.legal-card h3 {
  font-size: 1.15rem;
  margin: 1.25rem 0 0.6rem;
}

.legal-card p {
  margin-bottom: 1rem;
}

.legal-list {
  list-style: disc;
  padding-inline-start: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.legal-list li {
  margin-bottom: 0.5rem;
}

/* Alert / Callout Boxes */
.alert {
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
}

.alert-warning {
  background-color: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning-text);
}

.alert-warning h4,
.alert-warning p {
  color: var(--warning-text);
}

.alert-danger {
  background-color: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.alert-danger h4,
.alert-danger p {
  color: var(--danger-text);
}

.alert-info {
  background-color: var(--secondary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.alert-info h4,
.alert-info p {
  color: var(--primary-dark);
}

/* Forms */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.45rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--text-main);
  background: var(--bg-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(5, 122, 100, 0.14);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Honeypot anti-spam field */
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
}

.form-status {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  display: none;
}

.form-status.show {
  display: block;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content p {
    margin-inline: auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .grid-4, .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: inline-flex;
  }
  .nav-links {
    position: absolute;
    top: 80px;
    inset-inline: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-link {
    width: 100%;
    text-align: start;
  }
  .grid-2, .grid-3, .grid-4, .footer-grid {
    grid-template-columns: 1fr;
  }
  .legal-card, .form-card {
    padding: 1.5rem;
  }
}

/* Navigation text overlap fix */
@media (min-width: 769px) {
  .navbar {
    gap: 0.75rem;
    height: auto;
    min-height: 80px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .brand,
  .nav-actions {
    flex-shrink: 0;
  }

  .nav-links {
    flex: 1;
    min-width: 0;
    justify-content: center;
    gap: 0.15rem;
    flex-wrap: nowrap;
  }

  .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    word-break: keep-all;
    padding: 0.5rem 0.55rem;
    font-size: 0.88rem;
    line-height: 1.5;
    flex-shrink: 0;
  }
}

