:root {
    font-family:
        Pretendard,
        "Noto Sans KR",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: #282431;
    background: #f7f6fc;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(
            circle at top left,
            rgba(132, 105, 238, 0.16),
            transparent 38%
        ),
        linear-gradient(
            180deg,
            #faf9ff 0%,
            #f4f2fb 100%
        );
}

button,
input {
    font: inherit;
}

.child-login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding:
        max(24px, env(safe-area-inset-top))
        16px
        max(24px, env(safe-area-inset-bottom));
}

.child-login-card {
    width: min(100%, 470px);
    padding: 30px;
    border: 1px solid rgba(116, 98, 183, 0.12);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 22px 60px rgba(53, 43, 91, 0.12),
        0 4px 16px rgba(53, 43, 91, 0.05);
}

.child-login-header {
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.child-login-header__icon {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 19px;
    background: #eee9ff;
    font-size: 30px;
}

.child-login-header p {
    margin: 0 0 5px;
    color: #745fe0;
    font-size: 13px;
    font-weight: 800;
}

.child-login-header h1 {
    margin: 0;
    font-size: clamp(23px, 6vw, 30px);
    line-height: 1.25;
    letter-spacing: -0.04em;
}

.child-login-header > span:last-child {
    margin-top: 9px;
    color: #837d8c;
    font-size: 13px;
    line-height: 1.55;
}

.child-login-message {
    margin-top: 20px;
    padding: 12px 14px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.child-login-message--error {
    background: #fff0f1;
    color: #b44855;
}

.child-login-message--success {
    background: #eef9f4;
    color: #2f8264;
}

.child-login-form {
    margin-top: 25px;
}

.child-login-children {
    margin: 0;
    padding: 0;
    border: 0;
}

.child-login-children legend,
.child-login-field > span {
    display: block;
    margin-bottom: 9px;
    color: #4a4552;
    font-size: 13px;
    font-weight: 800;
}

.child-login-children__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.child-login-child {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 68px;
    padding: 10px 12px;
    border: 1px solid #e7e3ef;
    border-radius: 17px;
    background: #fff;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.child-login-child:hover {
    border-color: color-mix(
        in srgb,
        var(--child-color) 50%,
        #d8d2e6
    );
    transform: translateY(-1px);
}

.child-login-child input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.child-login-child:has(input:checked) {
    border-color: var(--child-color);
    background: color-mix(
        in srgb,
        var(--child-color) 10%,
        #fff
    );
    box-shadow: 0 7px 18px
        color-mix(
            in srgb,
            var(--child-color) 18%,
            transparent
        );
}

.child-login-child:has(input:focus-visible) {
    outline: 3px solid rgba(117, 94, 224, 0.2);
    outline-offset: 2px;
}

.child-login-child.is-unavailable {
    opacity: 0.56;
    cursor: not-allowed;
}

.child-login-child__avatar {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 13px;
    background: color-mix(
        in srgb,
        var(--child-color) 18%,
        #fff
    );
    font-size: 22px;
}

.child-login-child__text {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.child-login-child__text strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.child-login-child__text small {
    overflow: hidden;
    color: #8a8492;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.child-login-child__check {
    display: grid;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    background: #e8e4ef;
    color: transparent;
    font-size: 11px;
    font-weight: 900;
}

.child-login-child:has(input:checked)
.child-login-child__check {
    background: var(--child-color);
    color: #fff;
}

.child-login-field {
    display: block;
    margin-top: 20px;
}

.child-login-field input {
    width: 100%;
    height: 53px;
    padding: 0 16px;
    border: 1px solid #ded9e9;
    border-radius: 15px;
    outline: none;
    background: #fbfaff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-align: center;
}

.child-login-field input:focus {
    border-color: #8068e8;
    box-shadow: 0 0 0 4px rgba(128, 104, 232, 0.12);
}

.child-login-submit {
    width: 100%;
    min-height: 53px;
    margin-top: 16px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(135deg, #846ce9, #6953d6);
    box-shadow: 0 10px 22px rgba(105, 83, 214, 0.23);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

.child-login-submit:disabled {
    background: #c9c4d5;
    box-shadow: none;
    cursor: not-allowed;
}

.child-login-setup-guide {
    margin: 13px 0 0;
    color: #8a8492;
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

.child-login-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    margin-top: 24px;
    padding: 28px 18px;
    border-radius: 18px;
    background: #f8f6fd;
    text-align: center;
}

.child-login-empty > span {
    font-size: 36px;
}

.child-login-empty strong {
    margin-top: 10px;
}

.child-login-empty p {
    margin: 6px 0 0;
    color: #8a8492;
    font-size: 12px;
}

.child-login-admin-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 23px;
    color: #777181;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.child-login-admin-link:hover {
    color: #6953d6;
}

@media (max-width: 520px) {
    .child-login-page {
        align-items: start;
        padding-right: 12px;
        padding-left: 12px;
    }

    .child-login-card {
        padding: 25px 18px;
        border-radius: 24px;
    }

    .child-login-children__grid {
        gap: 8px;
    }

    .child-login-child {
        min-height: 64px;
        padding: 8px 9px;
        border-radius: 15px;
    }

    .child-login-child__avatar {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .child-login-child__check {
        display: none;
    }
}
