/* ============================================================
   ReadPlayRise — Plans parent space (/plans/parents, /plans/parent/{id})
   Loaded after readplayrise-public.css and built only from its tokens
   (--ink, --brand, --sky, --leaf, radii), so it reads as the onboarding page.
   Logical properties throughout: one stylesheet for RTL and LTR.
   ============================================================ */

[x-cloak] { display: none !important; }

.pp-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, var(--brand-tint) 0, transparent 38%),
        radial-gradient(circle at 92% 30%, var(--sky) 0, transparent 42%),
        #fff;
}

.pp-header-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; min-height: 76px;
}

.pp-main {
    width: min(760px, 100% - 2rem);
    margin-inline: auto;
    padding-block: 1.5rem 4rem;
    display: flex; flex-direction: column; gap: 1.25rem;
}

.pp-main--narrow { width: min(480px, 100% - 2rem); }

.pp-stack { display: flex; flex-direction: column; gap: 1.25rem; }

/* ---------- Intro ---------- */
.pp-hero { text-align: center; padding-block: .75rem .25rem; }

.pp-eyebrow {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .3rem .85rem; margin-block-end: .75rem;
    border-radius: var(--radius-pill);
    background: var(--brand-tint); color: var(--brand-text);
    font-size: .85rem; font-weight: 700;
}

.pp-title { font-size: clamp(1.7rem, 4.5vw, 2.3rem); }
.pp-title span { color: var(--brand-text); }

.pp-sub { margin-block-start: .5rem; font-size: 1.02rem; }

/* ---------- Cards ---------- */
.pp-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 40px rgba(22, 35, 63, .08);
    padding: clamp(1.25rem, 4vw, 2rem);
}

.pp-card--center { text-align: center; }

.pp-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; margin-block-end: .9rem;
    border-radius: 50%; background: var(--brand-tint); color: var(--brand);
}

.pp-icon--leaf { background: var(--leaf-tint); color: var(--leaf); }
.pp-icon svg { width: 30px; height: 30px; }

.pp-card h2 { font-size: 1.35rem; }

/* ---------- Form ---------- */
.pp-form { display: flex; flex-direction: column; gap: .9rem; margin-block-start: 1.1rem; text-align: start; }

.pp-label { color: var(--ink); font-weight: 700; font-size: .95rem; }

.pp-input {
    width: 100%; min-height: 54px; padding: .7rem 1rem;
    border: 2px solid var(--line); border-radius: var(--radius);
    background: #fbfcfe; color: var(--ink); font-size: 1.05rem;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.pp-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(234, 111, 12, .14); background: #fff; }
.pp-input[aria-invalid="true"] { border-color: #d64545; }

.pp-error { color: #b42323; font-size: .9rem; font-weight: 600; }

.pp-alert {
    padding: .85rem 1rem; border-radius: var(--radius);
    background: #fdecec; color: #8f1d1d; font-weight: 600; text-align: center;
}

.pp-note { margin-block-start: 1rem; font-size: .9rem; text-align: center; }

.pp-email { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }

.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }

.pp-spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .45); border-block-start-color: #fff;
    animation: pp-spin .8s linear infinite;
}

@keyframes pp-spin { to { transform: rotate(360deg); } }

.pp-actions { display: flex; flex-direction: column; gap: .65rem; margin-block-start: 1.25rem; }

.pp-link {
    color: var(--brand-text); font-weight: 700; text-decoration: none;
    border: 0; background: none; cursor: pointer; padding: .4rem;
}

.pp-link:hover { text-decoration: underline; }
.pp-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.pp-kids {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .9rem 1rem; border-radius: var(--radius);
    background: var(--sky); color: var(--sky-ink); font-weight: 600; font-size: .95rem;
    text-align: center; flex-wrap: wrap;
}

.pp-kids a { color: var(--sky-ink); font-weight: 800; }

/* ---------- Dashboard ---------- */
.pp-status { text-align: center; padding: 1rem; }

.pp-child-head { display: flex; align-items: center; gap: .9rem; }

.pp-avatar {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 54px; height: 54px; border-radius: 50%;
    background: linear-gradient(180deg, var(--sun), #ffad1f);
    color: var(--ink); font-family: 'Baloo Bhaijaan 2', 'Cairo', sans-serif; font-size: 1.5rem; font-weight: 800;
}

.pp-child-meta { font-size: .92rem; }

.pp-badge {
    display: inline-flex; align-items: center; padding: .2rem .7rem;
    border-radius: var(--radius-pill); font-size: .8rem; font-weight: 700;
    background: #f2f5f9; color: var(--body);
}

.pp-badge--active { background: var(--leaf-tint); color: var(--leaf-ink); }
.pp-badge--expired { background: #fdecec; color: #8f1d1d; }

.pp-code {
    margin-block-start: 1.1rem; padding: .9rem 1rem;
    border: 2px dashed #f6b27a; border-radius: var(--radius); background: var(--cream);
}

.pp-code-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-block-start: .3rem; }
.pp-code strong { color: var(--ink); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.35rem; letter-spacing: .06em; }
.pp-code small { display: block; margin-block-start: .35rem; font-size: .8rem; }

.pp-stats {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem;
    margin: 1.1rem 0 0;
}

.pp-stat { padding: .8rem .9rem; border-radius: var(--radius); background: #f7f9fc; }
.pp-stat dt { font-size: .8rem; font-weight: 600; }
.pp-stat dd { margin: .15rem 0 0; color: var(--ink); font-weight: 700; }

.pp-section-title { margin-block-start: 1.3rem; font-size: 1.05rem; }

.pp-words { display: flex; flex-direction: column; gap: .65rem; margin-block-start: .65rem; }

.pp-word-row { display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; }
.pp-word-row span:first-child { color: var(--ink); font-weight: 700; }

.pp-bar { height: 10px; margin-block-start: .3rem; border-radius: var(--radius-pill); background: var(--sky); overflow: hidden; }
.pp-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--leaf), #4cc35f); }

.pp-card .btn-block { margin-block-start: 1.3rem; }

@media (max-width: 480px) {
    .pp-stats { grid-template-columns: minmax(0, 1fr); }
    .logo { width: 78px; }
}

@media (prefers-reduced-motion: reduce) {
    .pp-spinner { animation-duration: 2s; }
}
