/*
    EPIC 60 WP1 (AH-1, AH-12, AH-15) - Welcome, Who's watching, Check your email, Family and settings,
    the set-up step bar and the child switcher. Builds on the home.css tokens (forest green, gold, Fredoka/Inter).
    Layout follows Lawrence's wireframes D01/M01, D02/M02, D12/M12. No red anywhere.
*/

.home-shell {
    --home-gold: #F2C14E;
    --home-gold-soft: #FBEFCB;
    --home-green: #1E3B34;
    --home-green-soft: #E7EFEA;
    --home-focus: 0 0 0 3px rgba(242, 193, 78, 0.55);
}

.home-acc {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-acc__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.home-acc__link {
    color: var(--home-green);
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.home-acc__link:hover,
.home-acc__link:focus-visible {
    text-decoration: underline;
}

.home-acc__eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--home-text-muted);
    margin: 0;
}

.home-acc__title {
    font-family: var(--home-font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    margin: 0;
    text-wrap: balance;
}

.home-acc__lead {
    font-size: 1.05rem;
    margin: 0;
}

.home-acc__note {
    color: var(--home-text-muted);
    font-size: 0.92rem;
    margin: 0;
}

/* Welcome: two doors */
.home-doors {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-door {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--home-card);
    border: 1px solid var(--home-hairline);
    border-radius: 16px;
    padding: 18px 20px;
    min-height: 44px;
    color: var(--home-text);
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.home-door:hover,
.home-door:focus-visible {
    border-color: var(--home-green);
    outline: none;
}

.home-door:focus-visible {
    box-shadow: var(--home-focus);
}

.home-door__icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--home-green-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    font-size: 1.5rem;
}

.home-door__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.home-door__title {
    font-family: var(--home-font-display);
    font-weight: 600;
    font-size: 1.15rem;
}

.home-door__chevron {
    font-size: 1.6rem;
    color: var(--home-text-muted);
}

.home-promise {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--home-gold-soft);
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 600;
}

/* The slime frame is 64x64 with the slime in its bottom-centre (about 24x23 px).
   Rendered at 1.5x (96x96) and pinned by its bottom so the body sits centred in the 48x44 slot. */
.home-promise__slime {
    position: relative;
    width: 48px;
    height: 44px;
    flex: none;
    overflow: hidden;
}

.home-promise__slime .asc-enemy-sprite {
    position: absolute;
    left: 50%;
    bottom: 5px;
    margin-left: -48px;
}

/* Forms */
.home-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-field label,
.home-field__label {
    font-weight: 600;
    font-size: 0.9rem;
}

.home-input,
.home-select {
    border: 1px solid #CBD2CC;
    border-radius: 12px;
    padding: 12px 14px;
    min-height: 48px;
    box-sizing: border-box;
    background: #FFFFFF;
    color: var(--home-text);
    font: inherit;
    width: 100%;
}

.home-input:focus-visible,
.home-select:focus-visible {
    outline: none;
    border-color: var(--home-green);
    box-shadow: var(--home-focus);
}

.home-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-pill {
    border: 1px solid #CBD2CC;
    background: #FFFFFF;
    border-radius: 999px;
    padding: 9px 16px;
    min-height: 44px;
    font: inherit;
    font-weight: 600;
    color: var(--home-text);
    cursor: pointer;
}

.home-pill--on,
.home-pill[aria-pressed="true"] {
    background: var(--home-green);
    border-color: var(--home-green);
    color: #FFFFFF;
}

.home-pill:focus-visible {
    outline: none;
    box-shadow: var(--home-focus);
}

.home-btn {
    border: 0;
    background: var(--home-green);
    color: #FFFFFF;
    border-radius: 14px;
    min-height: 52px;
    padding: 0 24px;
    font-family: var(--home-font-display);
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.home-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.home-btn:focus-visible {
    outline: none;
    box-shadow: var(--home-focus);
}

.home-btn--secondary {
    background: #FFFFFF;
    color: var(--home-green);
    border: 1px solid var(--home-green);
}

.home-btn--small {
    min-height: 40px;
    padding: 0 16px;
    font-size: 0.95rem;
    border-radius: 10px;
}

.home-reassure {
    background: var(--home-green-soft);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.92rem;
}

.home-message {
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--home-gold-soft);
    font-weight: 600;
}

.home-devlink {
    word-break: break-all;
    background: #FFFFFF;
    border: 1px dashed var(--home-text-muted);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.9rem;
}

/* Step bar */
.home-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-steps__label {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--home-text-muted);
}

.home-steps__bar {
    display: flex;
    gap: 6px;
}

.home-steps__segment {
    width: 34px;
    height: 6px;
    border-radius: 3px;
    background: var(--home-hairline);
}

.home-steps__segment--on {
    background: var(--home-gold);
}

/* Child switcher */
.home-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #FFFFFF;
}

.home-switcher__label {
    font-size: 0.85rem;
    opacity: 0.8;
}

.home-switcher__name {
    font-family: var(--home-font-display);
    font-weight: 600;
}

.home-switcher__select {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    padding: 6px 12px;
    min-height: 36px;
    font: inherit;
    font-weight: 600;
}

.home-switcher__select option {
    color: var(--home-text);
}

/* Family and settings */
.home-family {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.home-family__col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-section {
    background: var(--home-card);
    border: 1px solid var(--home-hairline);
    border-radius: var(--home-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-section__title {
    font-family: var(--home-font-display);
    font-weight: 600;
    font-size: 1.15rem;
    margin: 0;
}

.home-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--home-hairline);
}

.home-row:first-of-type {
    border-top: 0;
}

.home-row__main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.home-row__title {
    font-weight: 600;
}

.home-row__sub {
    color: var(--home-text-muted);
    font-size: 0.9rem;
}

.home-row--selected .home-row__title::after {
    content: " · selected";
    color: var(--home-text-muted);
    font-weight: 400;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-checks {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
}

.home-notice {
    background: var(--home-ground);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.92rem;
}

.home-notice p {
    margin: 0 0 6px;
}

.home-quote {
    font-style: italic;
    color: var(--home-text-muted);
}

@media (max-width: 640px) {
    .home-family {
        grid-template-columns: 1fr;
    }

    .home-acc__top {
        flex-wrap: wrap;
    }

    .home-btn {
        width: 100%;
    }

    .home-btn--small {
        width: auto;
    }
}

/* R21: a calm, amber note in a confirm step (never red). */
.home-warn {
    background: var(--home-gold-soft);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 8px 0;
    font-size: 0.92rem;
    line-height: 1.45;
}
