/* ===================================================================
   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: var(--ameen-font);
}

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

/* ── Page layout: one full-height mobile column, centred on wider screens.
   No device frame: 430px wide (the largest phone width), full viewport height,
   respecting the notch and home bar. ── */
.ameen-app-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--ameen-app-bg);
}

.ameen-app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  flex: 1;
  background-color: var(--ameen-app-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
}

/* ── 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;
}

.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: calc(84px + env(safe-area-inset-bottom, 0px));
}

/* ── 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 var(--ameen-c-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 var(--ameen-shadow);
  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 (matches ameen_mobile /app/(tabs)/_layout.tsx) ── */
.ameen-app-bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  background: var(--ameen-app-white);
  border-top: 1px solid var(--ameen-app-card-border);
  box-shadow: 0 -3px 6px var(--ameen-c-rgba-0-0-0-0-08);
  display: flex;
  justify-content: center;
  z-index: 100;
  box-sizing: border-box;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.ameen-app-bottom-nav__tabs {
  width: 100%;
  max-width: 430px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0;
  margin: 0;
  list-style: none;
  box-sizing: border-box;
}

.ameen-app-bottom-nav__item {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ameen-app-slate);
  position: relative;
  transition: color 0.18s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.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: 20px;
  position: relative;
  color: var(--ameen-app-slate);
  transition: background-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.ameen-app-bottom-nav__item:active .ameen-app-bottom-nav__icon-wrap {
  transform: scale(0.92);
}

.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: 700;
  font-size: 10px;
  line-height: 16px;
  margin-top: 4px;
  text-align: center;
  color: var(--ameen-app-slate);
  transition: color 0.18s ease;
}

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

/* Badge (matches ameen_mobile s.badge: 16x16, TC.btnWarm #F68B24, TC.btnText #FFFFFF) */
.ameen-app-bottom-nav__badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--ch-warm);
  color: var(--ameen-app-white);
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* ── 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;
  }
}
