/* ===================================================================
   Ameen Web App — Base App Pages & Flows
   Matches mobile design tokens from Figma:
   - 05.01 — Ali Overview — Default (Child Protection Overview)
   - Flow 02: Onboarding & Auth
   - Flow 03: Setup Wizard
   - Flow 06: Digital Agreement
   - Flow 07: Child Journey
   =================================================================== */

:root {
  --ameen-app-bg: #F7F9FD;
  --ameen-app-navy: #202F50;
  --ameen-app-slate: #737F96;
  --ameen-app-primary: #446BCD;
  --ameen-app-primary-dark: #1A66DB;
  --ameen-app-safe-bg: #E8F8F0;
  --ameen-app-safe-green: #159F6A;
  --ameen-app-blue-bg: #EFF3FE;
  --ameen-app-warm-bg: #FFF3E8;
  --ameen-app-card-border: #E1E7F0;
  --ameen-app-card-border-hover: #CFDAE9;
  --ameen-app-white: #FFFFFF;
  --ameen-app-font: 'Almarai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.ameen-app-body {
  margin: 0;
  padding: 0;
  background-color: #EDF2F8;
  color: var(--ameen-app-navy);
  font-family: var(--ameen-app-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ── Outer Layout (centers the phone shell on desktop, full-width on mobile) ── */
.ameen-app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  background: linear-gradient(180deg, #EBF1F9 0%, #E3EBF5 100%);
}

@media (min-width: 520px) {
  .ameen-app-layout {
    padding: 32px 16px 48px;
  }
}

/* ── App Shell / Mobile Canvas ── */
.ameen-app-shell {
  width: 100%;
  max-width: 414px;
  min-height: 100vh;
  background-color: var(--ameen-app-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  box-sizing: border-box;
}

@media (min-width: 520px) {
  .ameen-app-shell {
    min-height: 852px;
    border-radius: 40px;
    box-shadow: 0 24px 60px rgba(9, 23, 41, 0.14),
                0 4px 16px rgba(9, 23, 41, 0.06),
                inset 0 0 0 1px rgba(255, 255, 255, 0.85);
    border: 8px solid #16243A;
  }
}

/* ── Mobile Status Bar ── */
.ameen-app-status-bar {
  width: 100%;
  height: 48px;
  padding: 14px 24px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  font-family: var(--ameen-app-font);
  color: var(--ameen-app-navy);
  user-select: none;
  z-index: 10;
}

.ameen-app-status-bar__time {
  font-weight: 700;
  font-size: 13px;
  line-height: 21px;
  letter-spacing: -0.2px;
}

.ameen-app-status-bar__notch {
  width: 110px;
  height: 18px;
  background: transparent;
  border-radius: 0 0 12px 12px;
}

@media (min-width: 520px) {
  .ameen-app-status-bar__notch {
    background: #16243A;
    border-radius: 0 0 14px 14px;
    margin-top: -14px;
  }
}

.ameen-app-status-bar__icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 18px;
  font-weight: 700;
}

.ameen-app-status-bar__icons span {
  display: inline-block;
  line-height: 1;
}

/* ── Main App Content ── */
.ameen-app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 24px 28px;
  box-sizing: border-box;
}

.ameen-app-main--with-bottom-nav {
  padding-bottom: 110px;
}

/* ── 05.01 — Ali Overview — Default ── */
.ameen-overview-screen {
  direction: rtl;
  text-align: right;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
.ameen-overview-header {
  margin-bottom: 14px;
}

.ameen-overview-title {
  margin: 0 0 6px 0;
  font-family: var(--ameen-app-font);
  font-weight: 700;
  font-size: 26px;
  line-height: 42px;
  color: var(--ameen-app-navy);
  text-align: right;
}

.ameen-overview-subtitle {
  margin: 0;
  font-family: var(--ameen-app-font);
  font-weight: 400;
  font-size: 12px;
  line-height: 19px;
  color: var(--ameen-app-slate);
  text-align: right;
}

/* Hero / داخل نطاق المنزل */
.ameen-overview-hero {
  display: block;
  text-decoration: none;
  background: var(--ameen-app-safe-bg);
  border-radius: 23px;
  padding: 18px;
  margin-bottom: 18px;
  box-sizing: border-box;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
  position: relative;
  overflow: hidden;
}

.ameen-overview-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(21, 159, 106, 0.16);
  text-decoration: none;
}

.ameen-overview-hero:active {
  transform: scale(0.985);
}

.ameen-overview-hero__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.ameen-overview-hero__pin {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ameen-app-safe-green);
  font-size: 20px;
  animation: ameen-pin-pulse 2.8s ease-in-out infinite;
}

.ameen-overview-hero__zone {
  margin: 0;
  font-family: var(--ameen-app-font);
  font-weight: 700;
  font-size: 18px;
  line-height: 29px;
  color: var(--ameen-app-navy);
}

.ameen-overview-hero__sub {
  margin: 0;
  font-family: var(--ameen-app-font);
  font-weight: 400;
  font-size: 12px;
  line-height: 19px;
  color: var(--ameen-app-slate);
}

/* Section Title */
.ameen-overview-section-title {
  margin: 0 0 14px 0;
  font-family: var(--ameen-app-font);
  font-weight: 700;
  font-size: 17px;
  line-height: 27px;
  color: var(--ameen-app-navy);
  text-align: right;
}

/* Stack of 4 Category Cards */
.ameen-overview-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

.ameen-overview-card-item {
  box-sizing: border-box;
  min-height: 81px;
  background: var(--ameen-app-white);
  border: 1px solid var(--ameen-app-card-border);
  border-radius: 18px;
  padding: 16px 17px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
}

.ameen-overview-card-item:hover {
  transform: translateY(-2px);
  border-color: var(--ameen-app-card-border-hover);
  box-shadow: 0 8px 24px rgba(32, 47, 80, 0.08);
  text-decoration: none;
}

.ameen-overview-card-item:active {
  transform: scale(0.985);
}

.ameen-overview-card-item__icon-surface {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--ameen-app-primary);
  transition: transform 0.2s ease;
}

.ameen-overview-card-item:hover .ameen-overview-card-item__icon-surface {
  transform: scale(1.08);
}

.ameen-overview-card-item__icon-surface--safe {
  background: var(--ameen-app-safe-bg);
}

.ameen-overview-card-item__icon-surface--blue {
  background: var(--ameen-app-blue-bg);
}

.ameen-overview-card-item__icon-surface--warm {
  background: var(--ameen-app-warm-bg);
}

.ameen-overview-card-item__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ameen-overview-card-item__title {
  margin: 0;
  font-family: var(--ameen-app-font);
  font-weight: 700;
  font-size: 15px;
  line-height: 24px;
  color: var(--ameen-app-navy);
}

.ameen-overview-card-item__subtitle {
  margin: 0;
  font-family: var(--ameen-app-font);
  font-weight: 400;
  font-size: 12px;
  line-height: 19px;
  color: var(--ameen-app-slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ameen-overview-card-item__chev {
  color: var(--ameen-app-slate);
  font-size: 14px;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.ameen-overview-card-item:hover .ameen-overview-card-item__chev {
  color: var(--ameen-app-primary);
  transform: translateX(-4px);
}

html[dir="ltr"] .ameen-overview-card-item:hover .ameen-overview-card-item__chev {
  transform: translateX(4px);
}

/* Footnote */
.ameen-overview-footnote {
  margin: 2px 0 0 0;
  font-family: var(--ameen-app-font);
  font-weight: 400;
  font-size: 11px;
  line-height: 18px;
  color: var(--ameen-app-slate);
  text-align: right;
}

/* ── Bottom Navigation / Protection ── */
.ameen-app-bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 93px;
  background: var(--ameen-app-white);
  border-top: 1px solid var(--ameen-app-card-border);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 20;
  box-sizing: border-box;
}

@media (min-width: 520px) {
  .ameen-app-bottom-nav {
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
  }
}

.ameen-app-bottom-nav__tabs {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 61px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.ameen-app-bottom-nav__item {
  flex: 1;
  height: 61px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ameen-app-slate);
  position: relative;
  transition: color 0.2s ease;
  user-select: none;
}

.ameen-app-bottom-nav__item:hover {
  color: var(--ameen-app-navy);
  text-decoration: none;
}

.ameen-app-bottom-nav__icon-wrap {
  width: 40px;
  height: 30px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  position: relative;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.ameen-app-bottom-nav__item--active .ameen-app-bottom-nav__icon-wrap {
  background: var(--ameen-app-blue-bg);
  color: var(--ameen-app-primary);
}

.ameen-app-bottom-nav__label {
  font-family: var(--ameen-app-font);
  font-weight: 400;
  font-size: 11px;
  line-height: 12px;
  margin-top: 4px;
  text-align: center;
}

.ameen-app-bottom-nav__item--active .ameen-app-bottom-nav__label {
  font-weight: 700;
  color: var(--ameen-app-primary);
}

.ameen-app-bottom-nav__badge {
  position: absolute;
  top: 1px;
  inset-inline-end: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #F57829;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Home Indicator Bar */
.ameen-app-home-indicator {
  width: 125px;
  height: 5px;
  margin: 12px auto 0;
  background: var(--ameen-app-navy);
  opacity: 0.55;
  border-radius: 3px;
}

/* ── Animations ── */
.ameen-app-anim-fade-up {
  animation: ameenAppFadeUp 0.46s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ameen-app-delay-1 { animation-delay: 0.08s; }
.ameen-app-delay-2 { animation-delay: 0.16s; }
.ameen-app-delay-3 { animation-delay: 0.24s; }
.ameen-app-delay-4 { animation-delay: 0.32s; }

@keyframes ameenAppFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ameen-pin-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.14);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ameen-app-anim-fade-up,
  .ameen-overview-hero__pin {
    animation: none !important;
  }
  .ameen-overview-card-item,
  .ameen-overview-hero {
    transition: none !important;
  }
}
