/* ========================================
   Phone mockup and the app screens shown in it
   (hero stage, "Így működik" steps).

   The screens follow the app's own design: every colour and shadow is an
   app token from sd-tokens.css. Everything is em-based: 1em is one design
   pixel times (font-size / 16px), and the screen is 22.5em x 48.75em
   (360 x 780 design px), so a phone scales with --ph-fs and stays sharp.
   ======================================== */

/* ----------------------------------------
   1. Frame
   ---------------------------------------- */
.phone {
    --ph-fs: 13px;
    --ph-screen-h: 48.75em;
    position: relative;
    flex: none;
    width: 24em;
    padding: .75em;
    border-radius: 3.25em;
    background: var(--web-phone-bezel);
    box-shadow: var(--web-phone-shadow);
    font-size: var(--ph-fs);
    line-height: 1.25;
    text-align: left;
    color: var(--sd-text-body);
}

.phone__screen {
    position: relative;
    overflow: hidden;
    width: 22.5em;
    height: var(--ph-screen-h);
    border-radius: 2.5em;
    background: var(--web-phone-screen);
    /* A new stacking context keeps the screens' own layers inside the glass. */
    isolation: isolate;
}

.phone__notch {
    position: absolute;
    z-index: 20;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 7.5em;
    height: 1.75em;
    border-radius: 0 0 1em 1em;
    background: var(--web-phone-bezel);
}

.phone .scr {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding-top: 2.75em;
    overflow: hidden;
    background: var(--web-phone-screen);
}

/* Type scale: the app's text styles divided by 16 (Body/xsm 12/16 -> .75em/1em ...) */
.ph-h5  { font-size: 1.5em;  line-height: 1.1667; font-weight: 600; color: var(--sd-text-heading); }
.ph-h6  { font-size: 1.25em; line-height: 1.2;    font-weight: 600; color: var(--sd-text-heading); }
.ph-md  { font-size: 1em;    line-height: 1.25; }
.ph-sm  { font-size: .875em; line-height: 1.4286; }
.ph-xsm { font-size: .75em;  line-height: 1.3333; }
.ph-semi { font-weight: 600; }
.phone .t-muted { color: var(--sd-text-placeholder); }

/* Icons from the sprite (img/sd/icons.svg) */
.ic,
.ph-ic {
    width: 1.5em;
    height: 1.5em;
    fill: currentColor;
    flex: none;
}

/* Button (46 px surface on a 4 px edge) */
.ph-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    flex: none;
    height: 2.875em;
    border-radius: .5em;
    background: var(--sd-surface-action);
    box-shadow: 0 .25em 0 var(--sd-surface-action-hover);
    color: var(--sd-white);
    font-size: 1em;
    line-height: 1.25;
    font-weight: 700;
}

.ph-btn--success {
    width: 100%;
    background: var(--sd-surface-success);
    box-shadow: 0 .25em 0 var(--sd-surface-success-hover);
}

.ph-btn--block {
    margin: 1.5em 1em 0;
}

/* ----------------------------------------
   2. Learning path
   ---------------------------------------- */
.pth-ink { color: var(--sd-text-heading); }
.pth-on  { color: var(--sd-white); }

/* Top bar */
.pth-top {
    display: flex;
    align-items: center;
    gap: .5em;
    height: 2.5em;
    padding: 0 1em;
}

.pth-top__menu {
    margin-right: auto;
    color: var(--sd-icon-action);
}

.pth-chip {
    display: inline-flex;
    align-items: center;
    gap: .25em;
    height: 2em;
    padding: 0 .625em;
    border-radius: var(--sd-r-full);
    font-size: 1em;
    line-height: 1.25;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pth-chip .ph-ic {
    width: 1.25em;
    height: 1.25em;
}

.pth-chip--shield { background: var(--sd-blue-50);   color: var(--sd-blue-700); }
.pth-chip--flame  { background: var(--sd-orange-50); color: var(--sd-orange-700); }
.pth-chip--xp     { background: var(--sd-indigo-50); color: var(--sd-indigo-700); }
.pth-chip--shield .ph-ic { color: var(--sd-icon-info); }
.pth-chip--flame .ph-ic  { color: var(--sd-streak-flame); }
.pth-chip--xp .ph-ic     { color: var(--sd-yellow-500); }

/* Material picker card */
.pth-material {
    display: flex;
    align-items: center;
    gap: .75em;
    margin: .75em 1em 0;
    padding: .875em 1em;
    background: var(--sd-surface-default);
    border: 1px solid var(--sd-border-default);
    border-radius: 1.5em;
    box-shadow: 0 .1875em 0 var(--sd-border-default);
}

.pth-material__icon {
    display: grid;
    place-items: center;
    width: 3em;
    height: 3em;
    border-radius: .5em;
    background: var(--sd-indigo-50);
    color: var(--sd-icon-action);
}

.pth-material__icon .ph-ic {
    width: 1.75em;
    height: 1.75em;
}

.pth-material__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.pth-material__chev {
    color: var(--sd-icon-default);
}

/* Topic header: the only gradient, drawn as the app draws it (Topic -> Topic-end) */
.pth-topic {
    --t: var(--sd-topic-1);
    --t-end: var(--sd-topic-1-end);
    --t-edge: var(--sd-topic-1-edge);
    position: relative;
    display: flex;
    align-items: center;
    gap: .875em;
    margin: 1em 1em 0;
    padding: 1em 1.25em;
    border-radius: 1.5em;
    background: linear-gradient(90deg, var(--t) 35%, var(--t-end) 100%);
    box-shadow: 0 .375em 0 var(--t-edge);
    color: var(--sd-white);
}

.pth-topic--2 { --t: var(--sd-topic-2); --t-end: var(--sd-topic-2-end); --t-edge: var(--sd-topic-2-edge); }
.pth-topic--3 { --t: var(--sd-topic-3); --t-end: var(--sd-topic-3-end); --t-edge: var(--sd-topic-3-edge); }
.pth-topic.is-closed { margin-top: .875em; }

.pth-topic__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* Progress ring around the topic number (--p = share done, 0..1) */
.pth-ring {
    position: relative;
    display: grid;
    place-items: center;
    flex: none;
    width: 2.5em;
    height: 2.5em;
    border-radius: 50%;
    background: conic-gradient(var(--sd-white) calc(var(--p) * 1turn), var(--sd-on-topic-track) 0);
}

.pth-ring::before {
    content: "";
    position: absolute;
    inset: .1875em;
    border-radius: 50%;
    background: var(--t);
    box-shadow: inset 0 0 0 2em var(--sd-on-topic-subtle);
}

.pth-ring > span {
    position: relative;
}

/* Three nodes on a dashed route */
.pth-path {
    position: relative;
    flex: none;
    height: 16.25em;
    margin-top: .5em;
}

.pth-dash {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.pth-dash path {
    fill: none;
    stroke: var(--web-path-dash);
    stroke-width: 4;
    stroke-dasharray: 12 10;
    stroke-linecap: round;
}

.pth-row {
    position: absolute;
    display: flex;
    align-items: center;
    gap: .75em;
}

.pth-row--1 { left: 5.125em; top: .625em; }
.pth-row--2 { left: 13.25em; top: 5.75em; }
.pth-row--3 { left: 5.125em; top: 11.125em; }

.pth-row--2 .pth-label {
    position: absolute;
    right: calc(100% + .75em);
    top: 50%;
    transform: translateY(-50%);
}

.pth-label {
    display: block;
    width: 9.6em;
    padding: .5em .75em;
    background: var(--sd-surface-default);
    border-left: .25em solid var(--sd-text-disabled);
    border-radius: .25em;
    box-shadow: var(--sd-shadow-path-label);
    color: var(--sd-text-disabled);
}

.pth-label--active {
    border-left-color: var(--sd-topic-1);
    color: var(--sd-text-heading);
}

.ph-node {
    --t: var(--sd-topic-1);
    --t-edge: var(--sd-topic-1-edge);
    --t-ring: var(--sd-topic-1-ring);
    --t-subtle: var(--sd-topic-1-subtle);
    --t-accent: var(--sd-topic-1-accent);
    position: relative;
    display: grid;
    place-items: center;
    flex: none;
    width: 4.5em;
    height: 4.5em;
    border-radius: 50%;
    background: var(--t);
    box-shadow: 0 .375em 0 var(--t-edge);
    color: var(--sd-white);
}

.ph-node .ph-ic {
    width: 2.25em;
    height: 2.25em;
}

.ph-node--done {
    background: var(--t-subtle);
    box-shadow: 0 .375em 0 var(--t-ring);
    color: var(--t-accent);
}

.ph-node--premium {
    background: var(--sd-premium-fill);
    box-shadow: 0 .375em 0 var(--sd-premium-edge), inset 0 0 0 .3125em var(--sd-premium-ring);
    color: var(--sd-premium-icon);
}

.ph-node-wrap {
    position: relative;
    display: grid;
    flex: none;
}

.ph-node-wrap > * {
    grid-area: 1 / 1;
}

.ph-node__halo {
    width: 4.5em;
    height: 4.5em;
    border-radius: 50%;
    box-shadow: 0 0 0 .375em var(--sd-topic-1-ring), 0 .375em 0 .375em var(--sd-topic-1-ring);
}

.pth-bubble {
    position: absolute;
    z-index: 2;
    left: 2.25em;
    bottom: calc(100% + .75em);
    transform: translateX(-50%);
    padding: .125em .625em;
    border-radius: var(--sd-r-full);
    background: var(--sd-topic-1-callout);
    color: var(--sd-white);
    white-space: nowrap;
}

.pth-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: .4em solid transparent;
    border-top-color: var(--sd-topic-1-callout);
}

/* Material picker sheet (grade and subject) over a scrim */
.pth-scrim {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: var(--sd-scrim);
}

/* The app's bottom sheet: 24 px top corners, handle, Body/lg title, 24 px sides */
.sheet {
    position: absolute;
    z-index: 6;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    padding: .75em 1.5em 2em;
    background: var(--sd-surface-default);
    border-radius: 1.5em 1.5em 0 0;
    box-shadow: var(--sd-shadow-bottom-sheet);
}

.sheet__handle {
    align-self: center;
    flex: none;
    width: 2.5em;
    height: .25em;
    margin-bottom: 1em;
    border-radius: .125em;
    background: var(--sd-stone-300);
}

.sheet__title {
    margin-bottom: .8em;
    font-size: 1.25em;
    line-height: 1.2;
    font-weight: 600;
    color: var(--sd-text-heading);
}

/* Group label: a 16 px icon before the Body/xsm-semibold title */
.sheet__label {
    display: flex;
    align-items: center;
    gap: .5em;
    font-size: .75em;
    line-height: 1.3333;
    font-weight: 600;
    color: var(--sd-text-heading);
}

.sheet__label .ph-ic {
    width: 1.3333em;
    height: 1.3333em;
    color: var(--sd-icon-default);
}

.sheet__label--next {
    margin-top: 2em;
}

.sheet__chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5em;
    margin-top: .75em;
}

/* Chip: 36 px, fully round, Neutral/300 hairline; selected = Indigo/50 fill,
   action border, Indigo/700 semibold label with a check (grades) */
.ph-chip {
    display: inline-flex;
    align-items: center;
    gap: .25em;
    min-height: 2.25em;
    padding: .4375em .9375em;
    border: 1px solid var(--sd-stone-300);
    border-radius: 2em;
    background: var(--sd-surface-default);
    color: var(--sd-text-body);
    font-size: 1em;
    line-height: 1.25;
    white-space: nowrap;
}

.ph-chip .ph-ic {
    width: 1.125em;
    height: 1.125em;
}

/* Grades: three equal chips a row, a size smaller, so the nine fit in three rows */
.sheet__chips--grades {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .4375em;
}

.sheet__chips--grades .ph-chip {
    justify-content: center;
    gap: .2em;
    min-height: 2.2em;
    padding: .3em .4em;
    font-size: .8125em;
}

.sheet__chips--grades .ph-chip .ph-ic {
    width: 1.05em;
    height: 1.05em;
}

.ph-chip--subject {
    gap: .375em;
}

.ph-chip--subject .ph-ic {
    width: 1em;
    height: 1em;
}

.ph-chip.is-on {
    background: var(--sd-indigo-50);
    border-color: var(--sd-border-action);
    color: var(--sd-text-action-hover);
    font-weight: 600;
}

.sheet__btn {
    margin-top: 1.5em;
}

/* ----------------------------------------
   3. Quiz (after a correct answer)
   ---------------------------------------- */
.qz-head {
    display: flex;
    align-items: center;
    gap: .75em;
    padding: .5em 1em;
}

.qz-head__x {
    color: var(--sd-icon-action);
}

.qz-progress {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: .375em;
    padding: .5em 1em 0;
}

.qz-progress__pct {
    color: var(--sd-text-action);
}

.qz-progress__bar {
    grid-column: 1 / -1;
    height: .5em;
    border-radius: var(--sd-r-full);
    background: var(--sd-surface-subtle);
    overflow: hidden;
}

.qz-progress__bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--sd-surface-action);
}

.qz-card {
    margin: .875em 1em 0;
    padding: 1em;
    background: var(--sd-surface-default);
    border: 1px solid var(--sd-border-default);
    border-radius: 1.5em;
}

.qz-card__ask {
    display: flex;
    align-items: center;
    gap: .5em;
    padding-bottom: .75em;
    border-bottom: 1px solid var(--sd-border-default);
    color: var(--sd-text-body);
}

.qz-card__ask > .ph-ic {
    width: 1.25em;
    height: 1.25em;
}

/* Tanársegéd button */
.qz-assist {
    display: grid;
    place-items: center;
    width: 2.75em;
    height: 2.75em;
    margin-left: auto;
    border: .125em solid var(--sd-indigo-300);
    border-radius: .5em;
    background: var(--sd-surface-default);
    box-shadow: 0 .25em 0 var(--sd-indigo-300);
    color: var(--sd-icon-action);
}

.qz-card__q {
    display: block;
    margin-top: .75em;
}

.qz-opts {
    display: flex;
    flex-direction: column;
    gap: .625em;
    margin: .875em 1em 0;
    padding: 0;
    list-style: none;
}

.qz-opt {
    display: flex;
    align-items: center;
    gap: .75em;
    min-height: 3.5em;
    padding: .625em 1em;
    background: var(--sd-surface-default);
    border: .125em solid var(--sd-border-strong);
    border-radius: .5em;
    color: var(--sd-text-heading);
}

.qz-opt__key {
    display: grid;
    place-items: center;
    flex: none;
    width: 2em;
    height: 2em;
    border-radius: .375em;
    background: var(--sd-surface-muted);
    color: var(--sd-text-heading);
}

.qz-opt__key .ph-ic {
    width: 1.25em;
    height: 1.25em;
}

.qz-opt--ok {
    background: var(--sd-surface-success-subtle);
    border-color: var(--sd-border-success);
    color: var(--sd-text-success);
}

.qz-opt--ok .qz-opt__key {
    background: var(--sd-surface-success);
    color: var(--sd-white);
}

/* Feedback sheet */
.qz-fb {
    position: absolute;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: .5em;
    padding: 1.25em 1.25em 1.75em;
    background: var(--sd-surface-success-subtle);
    color: var(--sd-text-success);
}

.qz-fb__title {
    display: flex;
    align-items: center;
    gap: .5em;
}

.qz-fb__title .ph-ic {
    width: 1.75em;
    height: 1.75em;
    color: var(--sd-icon-success);
}

.qz-fb__title .ph-h5 {
    color: var(--sd-text-success);
}

.qz-fb .ph-btn {
    margin-top: .5em;
}

/* ----------------------------------------
   4. Streak milestone
   ---------------------------------------- */
.phone .scr-streak {
    padding-top: 0;
}

.stk-hero {
    position: relative;
    flex: none;
    height: 13.5em;
    /* Warm backdrop with a bowed lower edge, as in the app */
    background: var(--sd-streak-header-bg);
    border-radius: 0 0 50% 50% / 0 0 16% 16%;
    overflow: hidden;
}

/* The flame artwork is 165 x 228: height = width * 1.378 */
.stk-hero__flame {
    position: absolute;
    bottom: 2.3em;
    width: 4.8em;
    height: 6.62em;
    color: var(--sd-streak-flame-light);
}

.stk-hero__flame--l { left: 2.25em;  transform: rotate(-12deg); }
.stk-hero__flame--r { right: 2.25em; transform: rotate(12deg) scaleX(-1); }

.stk-hero__flame--c {
    left: 50%;
    bottom: 2.5em;
    width: 6.4em;
    height: 8.82em;
    margin-left: -3.2em;
    color: var(--sd-streak-flame);
}

.stk-hero__count {
    position: absolute;
    left: 50%;
    bottom: 1.05em;
    transform: translateX(-50%);
    font-size: 3.2em;
    line-height: 1;
    font-weight: 700;
    color: var(--sd-white);
}

.stk-title {
    display: block;
    margin-top: .75em;
    padding: 0 1.5em;
    text-align: center;
}

.stk-week {
    display: flex;
    justify-content: space-between;
    margin: 1.5em 0 0;
    padding: 0 1.5em;
    list-style: none;
}

.stk-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25em;
    color: var(--sd-text-placeholder);
}

.stk-flame {
    width: 1.75em;
    height: 2.4em;
    color: var(--sd-streak-flame);
}

.stk-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75em;
    margin: 1.5em 1em 0;
}

.stk-stat {
    display: flex;
    flex-direction: column;
    gap: .375em;
    padding: 1em;
    background: var(--sd-surface-default);
    border: 1px solid var(--sd-border-default);
    border-radius: 1.5em;
    box-shadow: 0 .1875em 0 var(--sd-border-default);
}

.stk-stat__tile {
    display: grid;
    place-items: center;
    width: 2.25em;
    height: 2.25em;
    border-radius: .5em;
}

.stk-stat__tile .ph-ic {
    width: 1.375em;
    height: 1.375em;
}

.stk-stat__tile--xp { background: var(--sd-indigo-50); color: var(--sd-icon-action); }
.stk-stat__tile--ok { background: var(--sd-green-50);  color: var(--sd-icon-success); }

.stk-stat__num {
    font-size: 2em;
    line-height: 1.25;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--sd-text-heading);
}
