/*
 * Mama Papa Bank theme layer on top of vendored Bootstrap 5.3.
 * Two moods, one stylesheet: the parent theme (calm, banking-teal) is the default;
 * data-theme="kids" (NOT data-bs-theme, which is Bootstrap's own color-mode switch)
 * switches child-facing pages to the playful palette.
 */
:root {
  --mp-primary: #1f6f8b;
  --mp-primary-dark: #185a72;
  --mp-primary-rgb: 31, 111, 139;
  --mp-accent: #e8a33d;
  --mp-surface: #f5f8fa;

  --bs-primary: var(--mp-primary);
  --bs-primary-rgb: var(--mp-primary-rgb);
  --bs-link-color: var(--mp-primary);
  --bs-link-color-rgb: var(--mp-primary-rgb);
  --bs-link-hover-color: var(--mp-primary-dark);
  --bs-body-bg: var(--mp-surface);
  --bs-border-radius: 0.5rem;
}

/*
 * Child theme. Contrast (WCAG AA, checked numerically): primary #0a7274 on cream is 5.4:1 and
 * white on it 5.7:1. Coral and sun-yellow are ONLY ever backgrounds under dark text (5.5:1 / 9.8:1);
 * white on coral would fail (2.6:1), so it is never used.
 */
[data-theme="kids"] {
  --mp-primary: #0a7274;
  --mp-primary-dark: #075759;
  --mp-primary-rgb: 10, 114, 116;
  --mp-accent: #ff7a59;
  --mp-sun: #ffd166;
  --mp-surface: #fff8ec;
  --bs-body-bg: #fff8ec;
  --bs-border-radius: 1rem;
  --bs-border-radius-lg: 1.5rem;
  --bs-body-font-size: 1.1rem;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Bootstrap 5.3 bakes button colors in at compile time, so remap them to our variables. */
.btn-primary {
  --bs-btn-bg: var(--mp-primary);
  --bs-btn-border-color: var(--mp-primary);
  --bs-btn-hover-bg: var(--mp-primary-dark);
  --bs-btn-hover-border-color: var(--mp-primary-dark);
  --bs-btn-active-bg: var(--mp-primary-dark);
  --bs-btn-active-border-color: var(--mp-primary-dark);
  --bs-btn-disabled-bg: var(--mp-primary);
  --bs-btn-disabled-border-color: var(--mp-primary);
}
.btn-outline-primary {
  --bs-btn-color: var(--mp-primary);
  --bs-btn-border-color: var(--mp-primary);
  --bs-btn-hover-bg: var(--mp-primary);
  --bs-btn-hover-border-color: var(--mp-primary);
  --bs-btn-active-bg: var(--mp-primary-dark);
  --bs-btn-active-border-color: var(--mp-primary-dark);
}
.text-primary {
  color: var(--mp-primary) !important;
}
.bg-primary {
  background-color: var(--mp-primary) !important;
}

.app-navbar {
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.app-navbar .navbar-brand {
  color: var(--mp-primary);
}
[data-theme="kids"] .app-navbar {
  background: var(--mp-primary);
}
[data-theme="kids"] .app-navbar .navbar-brand,
[data-theme="kids"] .app-navbar .navbar-text {
  color: #fff;
}

.card {
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.auth-card {
  max-width: 32rem;
  margin: 1rem auto;
}

/* Visually hidden off-screen (NOT display:none) — the registration honeypot. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Balance figure (the visual centerpiece) */
.balance {
  font-size: 2rem;
  font-weight: 700;
  color: var(--mp-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
[data-theme="kids"] .balance {
  font-size: 3rem;
}
.min-w-0 {
  min-width: 0;
}
.child-card .card-footer {
  border-top: 0;
}
.avatar {
  border-radius: 50%;
  flex: none;
}
.tx-icon {
  font-size: 1.4rem;
  line-height: 1;
}

/* Avatar picker (radio tiles) */
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem;
}
.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  border: 2px solid transparent;
  border-radius: var(--bs-border-radius);
  cursor: pointer;
  font-size: 0.85rem;
}
.avatar-option:hover {
  background: rgba(var(--mp-primary-rgb), 0.06);
}
.btn-check:checked + .avatar-option {
  border-color: var(--mp-primary);
  background: rgba(var(--mp-primary-rgb), 0.1);
}
.btn-check:focus-visible + .avatar-option {
  outline: 3px solid rgba(var(--mp-primary-rgb), 0.4);
}

/* ---- Child theme components ---- */
[data-theme="kids"] body {
  background-image: radial-gradient(rgba(10, 114, 116, 0.07) 2px, transparent 2px);
  background-size: 28px 28px;
}
/* Big touch targets (>= 48px) */
[data-theme="kids"] .btn {
  --bs-btn-padding-y: 0.7rem;
  --bs-btn-padding-x: 1.25rem;
  --bs-btn-font-size: 1.05rem;
  --bs-btn-border-radius: 999px;
  min-height: 3rem;
  font-weight: 600;
}
[data-theme="kids"] .form-control,
[data-theme="kids"] .form-select {
  min-height: 3.25rem;
}
[data-theme="kids"] .card {
  border-radius: 1.5rem;
  border: 0;
  box-shadow: 0 0.25rem 0 rgba(10, 114, 116, 0.12);
}
[data-theme="kids"] .list-group-item {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.kid-hero {
  background: linear-gradient(135deg, var(--mp-primary) 0%, #0d9a9c 100%);
  color: #fff;
}
.kid-hero .avatar {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.55);
}
.balance-hero {
  font-size: clamp(2.75rem, 12vw, 4.25rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0.15rem 0 rgba(10, 114, 116, 0.12);
  font-weight: 600;
}
.chip .bi {
  color: var(--mp-primary);
}
.kid-tx-amount {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
}
.kid-tx-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mp-sun);
  color: #2b2b2b;
  font-size: 1.3rem;
  flex: none;
}
.kid-tx-icon.out {
  background: var(--mp-accent);
}

/* ---- Savings goals ---- */
.goal-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--mp-primary-rgb), 0.12);
  color: var(--mp-primary);
  font-size: 1.35rem;
  flex: none;
}
.goal-done .goal-icon {
  background: var(--mp-sun, #ffd166);
  color: #2b2b2b;
}
.goal-progress {
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(var(--mp-primary-rgb), 0.12);
}
.goal-progress .progress-bar {
  width: var(--w, 0%);
  min-width: 2.5rem;
  background: var(--mp-primary);
  font-weight: 700;
  animation: goal-fill 0.9s ease-out;
}
.goal-progress .progress-bar.bg-success {
  background: #146c43 !important;
}
[data-theme="kids"] .goal-progress {
  height: 2rem;
}
@keyframes goal-fill {
  from {
    width: 0;
  }
}
.flex-none {
  flex: none;
}

.celebrate-banner {
  background: var(--mp-sun, #ffd166);
  color: #2b2b2b;
  border: 0;
  border-radius: 1.5rem;
  box-shadow: 0 0.25rem 0 rgba(0, 0, 0, 0.12);
  padding: 1.25rem 1.5rem;
}
.celebrate-icon {
  font-size: 2.5rem;
  line-height: 1;
  animation: celebrate-pop 0.6s ease-out;
}
@keyframes celebrate-pop {
  0% {
    transform: scale(0.4) rotate(-20deg);
  }
  70% {
    transform: scale(1.2) rotate(8deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}
canvas.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2000;
}

/* The child navbar carries four pill buttons: shrink them a little so they wrap instead of overflowing at 375px. */
[data-theme="kids"] .app-navbar .btn-sm {
  --bs-btn-padding-x: 0.9rem;
  --bs-btn-padding-y: 0.35rem;
  min-height: 2.75rem;
}

/* ---- Landing page ---- */
.landing-avatars {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.landing-avatars .avatar {
  box-shadow: 0 0 0 3px #fff;
  margin-left: -0.75rem;
}
.landing-avatars .avatar:first-child {
  margin-left: 0;
}
.landing-step {
  font-size: 2.25rem;
  line-height: 1;
}
.landing-cta {
  background: linear-gradient(135deg, rgba(var(--mp-primary-rgb), 0.1), rgba(232, 163, 61, 0.16));
  border: 0;
}

/* Legal pages: long URLs (e.g. processor agreements) must wrap instead of widening the page on phones. */
.legal a {
  overflow-wrap: anywhere;
}

span#emailname::after {
  content: "@mama-papa-bank.de";
}
span#emailname::before {
  content: "hallo";
}
span#mymail {
  display: none;
}
span#phone::after {
  content: " 605 908 67";
}
span#phone::before {
  content: "+49 40";
}
span#myphone {
  display: none;
}
