/* ============================================================
   Almanassa — Modern Design System
   Shared by login + landing + future pages
   ============================================================ */

:root {
  --am-primary: #2B3674;
  --am-accent:  #5B6EFF;
  --am-accent-soft: #7C8CFF;
  --am-success: #22C993;
  --am-warning: #FFB547;
  --am-danger:  #FF6B6B;
  --am-info:    #11B6CF;
  --am-purple:  #8D5CF6;

  /* Light theme (default) */
  --am-bg:          #F7F8FC;
  --am-bg-2:        #EEF2FF;
  --am-card:        #FFFFFF;
  --am-card-soft:   rgba(255,255,255,0.85);
  --am-text:        #2B3674;
  --am-text-muted:  #8A91B4;
  --am-border:      #EEF0F5;
  --am-shadow:      0 8px 24px rgba(15, 23, 42, 0.06);
  --am-shadow-lg:   0 16px 48px rgba(15, 23, 42, 0.10);
  --am-glow:        0 0 32px rgba(91, 110, 255, 0.25);
}

[data-theme="dark"] {
  --am-bg:          #0B1224;
  --am-bg-2:        #1A2236;
  --am-card:        #1A2236;
  --am-card-soft:   rgba(26,34,54,0.75);
  --am-text:        #E8EBF7;
  --am-text-muted:  #8A91B4;
  --am-border:      #2A3247;
  --am-shadow:      0 8px 24px rgba(0, 0, 0, 0.4);
  --am-shadow-lg:   0 16px 48px rgba(0, 0, 0, 0.5);
  --am-glow:        0 0 32px rgba(91, 110, 255, 0.45);
}

/* ----- Base ----- */
html.am-page, body.am-page {
  background: var(--am-bg);
  color: var(--am-text);
  font-family: 'Cairo', 'Tajawal', 'Open Sans', sans-serif;
  transition: background 0.4s ease, color 0.4s ease;
}

/* ----- Gradient backdrop ----- */
.am-bg-gradient {
  background: linear-gradient(135deg, var(--am-bg) 0%, var(--am-bg-2) 100%);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Decorative floating blobs */
.am-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: am-blob-float 18s ease-in-out infinite;
  pointer-events: none;
}
.am-blob-1 { top: -80px; right: -60px; width: 320px; height: 320px; background: var(--am-accent); }
.am-blob-2 { bottom: -120px; left: -100px; width: 380px; height: 380px; background: var(--am-primary); animation-delay: -8s; }
.am-blob-3 { top: 40%; left: 60%; width: 240px; height: 240px; background: var(--am-purple); animation-delay: -4s; opacity: 0.3; }

@keyframes am-blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.08); }
  66% { transform: translate(-25px, 30px) scale(0.95); }
}

/* ----- Glass card ----- */
.am-glass {
  background: var(--am-card-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--am-border);
  border-radius: 20px;
  box-shadow: var(--am-shadow-lg);
}

/* ----- Logo / brand mark ----- */
.am-logo-disc {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #fff;
  padding: 8px;
  box-shadow: var(--am-glow), var(--am-shadow);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: am-pulse 2.4s ease-in-out infinite;
}
.am-logo-disc img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

@keyframes am-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(91,110,255,0.30), 0 8px 24px rgba(0,0,0,0.08); }
  50%      { box-shadow: 0 0 48px rgba(91,110,255,0.55), 0 12px 36px rgba(0,0,0,0.12); }
}

/* ----- Brand title ----- */
.am-brand {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--am-accent);
  text-align: center;
  margin-top: 18px;
  text-shadow: 0 4px 18px rgba(91,110,255,0.30);
}
.am-brand-sub {
  text-align: center;
  color: var(--am-text-muted);
  font-size: 14px;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* ----- Inputs ----- */
.am-input {
  width: 100%;
  background: var(--am-card);
  border: 1.5px solid var(--am-border);
  color: var(--am-text);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  outline: none;
  font-family: inherit;
}
.am-input:focus {
  border-color: var(--am-accent);
  box-shadow: 0 0 0 4px rgba(91,110,255,0.15);
}
.am-input::placeholder { color: var(--am-text-muted); }

.am-field-group {
  position: relative;
  margin-bottom: 20px;
}
.am-field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--am-text);
  margin-bottom: 8px;
  display: block;
  line-height: 1.5;
}
.am-field-icon {
  position: absolute;
  bottom: 14px;            /* vertically center within the input (which is the bottom element) */
  right: 16px;
  color: var(--am-text-muted);
  pointer-events: none;
  line-height: 1;
}
.am-field-group.has-icon .am-input { padding-right: 44px; }

/* ----- Buttons ----- */
.am-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.25s, background 0.25s;
  text-decoration: none;
  white-space: nowrap;
}
.am-btn-primary {
  background: linear-gradient(135deg, var(--am-accent), var(--am-primary));
  color: white;
  box-shadow: 0 8px 24px rgba(91,110,255,0.40);
}
.am-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(91,110,255,0.55);
  color: white;
}
.am-btn-outline {
  background: transparent;
  color: var(--am-accent);
  border: 2px solid var(--am-accent);
}
.am-btn-outline:hover {
  background: var(--am-accent);
  color: white;
  transform: translateY(-2px);
}
.am-btn-block { width: 100%; }

/* ----- Theme toggle ----- */
.am-theme-toggle {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--am-card);
  border: 1px solid var(--am-border);
  color: var(--am-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  box-shadow: var(--am-shadow);
  transition: transform 0.3s, background 0.3s;
}
.am-theme-toggle:hover { transform: rotate(20deg) scale(1.1); }

/* ----- Animations ----- */
.am-fade-up {
  opacity: 0;
  transform: translateY(28px);
  animation: am-fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.am-fade-up-delay-1 { animation-delay: 0.15s; }
.am-fade-up-delay-2 { animation-delay: 0.30s; }
.am-fade-up-delay-3 { animation-delay: 0.45s; }
.am-fade-up-delay-4 { animation-delay: 0.60s; }

@keyframes am-fade-up {
  to { opacity: 1; transform: translateY(0); }
}

.am-scale-in {
  opacity: 0;
  transform: scale(0.92);
  animation: am-scale-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes am-scale-in {
  to { opacity: 1; transform: scale(1); }
}

/* On-scroll reveal */
.am-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.am-reveal.am-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----- Hero (landing) ----- */
.am-hero {
  padding: 100px 0 80px;
  position: relative;
  text-align: center;
}
.am-hero-eyebrow {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(91,110,255,0.12);
  color: var(--am-accent);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
  border: 1px solid rgba(91,110,255,0.25);
}
.am-hero-title {
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 900;
  margin: 0 0 18px;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--am-primary), var(--am-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.am-hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  max-width: 720px;
  margin: 0 auto 32px;
  color: var(--am-text-muted);
  line-height: 1.7;
}
.am-hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ----- Feature card ----- */
.am-feature {
  background: var(--am-card);
  border: 1px solid var(--am-border);
  border-radius: 20px;
  padding: 36px 26px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;                            /* fill grid cell */
  box-shadow: var(--am-shadow);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.am-feature:hover {
  transform: translateY(-6px);
  box-shadow: var(--am-shadow-lg);
  border-color: var(--am-accent);
}
.am-feature-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(91,110,255,0.18), rgba(91,110,255,0.04));
  border: 1px solid rgba(91,110,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
  color: var(--am-accent);
  transition: transform 0.3s;
  flex-shrink: 0;
}
.am-feature:hover .am-feature-icon { transform: scale(1.1) rotate(-6deg); }
.am-feature h3 {
  font-size: 19px; font-weight: 800; margin: 0 0 12px; color: var(--am-text); line-height: 1.3;
}
.am-feature p {
  font-size: 14px; color: var(--am-text-muted); margin: 0;
  line-height: 1.75; flex-grow: 1;
}

/* ----- Section ----- */
.am-section {
  padding: 80px 0;
  position: relative;
}

/* Force 3 columns on wide screens for predictable layouts */
.am-grid-3-fixed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 28px;        /* row-gap col-gap — more vertical air between rows */
  align-items: stretch;
}
.am-grid-3-fixed > * { min-width: 0; height: 100%; }
@media (max-width: 992px) { .am-grid-3-fixed { grid-template-columns: repeat(2, 1fr); gap: 28px 22px; } }
@media (max-width: 600px) { .am-grid-3-fixed { grid-template-columns: 1fr; gap: 22px; } }

/* Make any grid child shrink to its column (prevents overflow into siblings) */
.am-grid-2 > *, .am-grid-3 > * { min-width: 0; }
.am-grid-3 { gap: 28px; }

/* Policy / long-text page wrapper */
.am-policy {
  max-width: 880px;
  margin: 0 auto;
  padding: 50px 30px;
  background: var(--am-card);
  border: 1px solid var(--am-border);
  border-radius: 22px;
  box-shadow: var(--am-shadow);
  line-height: 1.9;
  color: var(--am-text);
}
.am-policy h2 {
  font-size: 22px; font-weight: 800; color: var(--am-accent);
  margin: 28px 0 12px; padding-right: 14px;
  border-right: 4px solid var(--am-accent);
}
.am-policy h3 {
  font-size: 17px; font-weight: 700; color: var(--am-text);
  margin: 18px 0 8px;
}
.am-policy p {
  font-size: 15px; color: var(--am-text);
  margin: 10px 0;
}
.am-policy ul, .am-policy ol { padding-right: 22px; margin: 10px 0; }
.am-policy li { margin: 6px 0; color: var(--am-text); font-size: 14.5px; }
.am-policy a { color: var(--am-accent); font-weight: 600; }
.am-policy-hero {
  text-align: center; padding: 50px 20px 30px;
}
.am-policy-hero-icon {
  width: 72px; height: 72px; margin: 0 auto 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--am-accent), var(--am-primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; box-shadow: var(--am-glow);
}
.am-section-head {
  text-align: center;
  margin-bottom: 50px;
}
.am-section-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  color: var(--am-accent);
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.am-section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  margin: 0 0 14px;
  color: var(--am-text);
}
.am-section-subtitle {
  font-size: 16px;
  color: var(--am-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ----- Mobile preview card (landing) ----- */
.am-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-top: 50px;
}
.am-stat {
  text-align: center;
  padding: 24px 18px;
  background: var(--am-card);
  border: 1px solid var(--am-border);
  border-radius: 18px;
  transition: transform 0.3s;
}
.am-stat:hover { transform: translateY(-4px); }
.am-stat-num {
  font-size: 36px;
  font-weight: 900;
  color: var(--am-accent);
  margin-bottom: 4px;
}
.am-stat-label {
  font-size: 13px;
  color: var(--am-text-muted);
  font-weight: 600;
}
