:root {
    --bg: #000;
    --panel: #1c1c1e;
    --text: #fff;
    --muted: #98989d;
    --accent: #A588F9;
    --input-bg: #1c1c1e;
    --border: #38383a;
    --white: #fff;
    --shadow: rgb(0 0 0 / 30%);
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f2f2f7;
        --panel: #fff;
        --text: #000;
        --muted: #8e8e93;
        --accent: #A588F9;
        --input-bg: #fff;
        --border: rgb(0 0 0 / 10%);
        --white: #000;
        --shadow: rgb(0 0 0 / 8%);
    }
}

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    height: 100%;
    background: var(--bg);
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    center {
        display: block;
        text-align: center;

        img {
            display: inline-block;
        }
    }

    left {
        display: block;
        text-align: left;
    }

    right {
        display: block;
        text-align: right;
    }

    body {
        margin: 0;
        height: 100%;
        color: var(--text);

        main {
            max-width: 40rem;
            margin: 0 auto;
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            min-height: 100%;

            .bar {
                height: .5rem;
                display: block;
                border-radius: .5rem;
                background: var(--border);
                font-size: 0;
                margin: .5rem 0;
                margin-bottom: 2rem;

                .fill {
                    display: inline-block;
                    background: var(--accent);
                    height: 100%;
                    border-radius: .5rem;
                }
            }

            h1 {
                font-size: 2rem;
                font-weight: 700;
                margin-bottom: 0.5rem;
                letter-spacing: -0.02em;
            }

            h2 {
                font-size: 1.5rem;
                font-weight: 600;
                margin-bottom: 0.5rem;
                letter-spacing: -0.01em;
            }

            h3 {
                font-size: 1.2rem;
                font-weight: 500;
                margin-bottom: 0.5rem;
                letter-spacing: -0.01em;
            }

            p {
                color: var(--muted);
                line-height: 1.4;
                font-size: 0.95rem;
            }

            .card {
                background: var(--panel);
                padding: 1.25rem;
                border-radius: 0.75rem;
                margin-bottom: 1rem;
                border: 1px solid var(--border);
                box-shadow: 0 1px 3px var(--shadow);
            }

            button {
                width: 100%;
                background: var(--panel);
                color: var(--text);
                border: 1px solid var(--border);
                padding: 0.875rem 1rem;
                border-radius: 0.625rem;
                font-size: 1.0625rem;
                font-weight: 400;
                cursor: pointer;
                margin-bottom: 0.75rem;
                min-height: 2.75rem;
                transition: all 0.15s ease;
                touch-action: manipulation;

                &:active {
                    transform: scale(0.97);
                    opacity: 0.8;
                }

                &.primary {
                    background: var(--accent);
                    border: none;
                    color: var(--white);
                    font-weight: 600;
                    box-shadow: 0 2px 8px rgb(165 136 249 / 25%);

                    &:active {
                        box-shadow: 0 1px 4px rgb(165 136 249 / 20%);
                    }
                }

                &.link {
                    background: none;
                    border: none;
                    color: var(--accent);
                    padding: 0.5rem 0;
                    min-height: auto;
                    font-weight: 400;
                }
            }

            radios {
                display: flex;
                flex-direction: row;
                align-items: center;
                justify-content: center;
                gap: .5rem;

                .radio {
                    padding-top: 1rem;
                    background: var(--input-bg);
                    border: 1px solid var(--border);
                    border-radius: 0.625rem;
                    margin: 1rem 0;
                    font-weight: 500;
                    display: block;
                    text-align: center;
                    min-width: 10%;
                    height: 7.5rem;
                    flex: 1;

                    e {
                        font-size: 2rem;
                        display: block;
                        margin-bottom: .5rem;
                    }

                    input {
                        display: none;
                    }

                    &:has(input:checked) {
                        background: var(--accent);
                        color: #000;
                    }

                    span {
                        font-size: .8rem;
                    }
                }
            }

            .radio-group {
                label {
                    display: flex;
                    align-items: center;
                    padding: 1rem;
                    border: 1px solid var(--border);
                    border-radius: 0.625rem;
                    margin-bottom: 0.625rem;
                    cursor: pointer;
                    min-height: 2.75rem;
                    transition: all 0.15s ease;
                    touch-action: manipulation;
                    background: var(--panel);

                    &:active {
                        transform: scale(0.98);
                        background: var(--input-bg);
                    }

                }

                input {
                    display: none;

                    &:checked+span {
                        color: var(--accent);
                        font-weight: 500;
                    }

                    &:checked~label {
                        border-color: var(--accent);
                        background: rgb(165 136 249 / 5%);
                    }
                }
            }

            textarea {
                width: 100%;
                background: var(--input-bg);
                border: 1px solid var(--border);
                color: var(--text);
                padding: 0.875rem;
                border-radius: 0.625rem;
                font-size: 1.0625rem;
                min-height: 7rem;
                resize: none;
                font-family: inherit;
                line-height: 1.4;
                transition: border-color 0.15s ease;
                field-sizing: content;

                &:focus {
                    outline: none;
                    border-color: var(--accent);
                }
            }

            label {
                display: block;
                padding-bottom: 1rem;

                b {
                    display: block;
                    padding-bottom: 0.5rem;
                    font-size: 0.8125rem;
                    font-weight: 600;
                    text-transform: uppercase;
                    letter-spacing: 0.02em;
                    color: var(--muted);
                }

                input {
                    width: 100%;
                    background: var(--input-bg);
                    border: 1px solid var(--border);
                    color: var(--text);
                    padding: 0.875rem;
                    border-radius: 0.625rem;
                    font-size: 1.0625rem;
                    min-height: 2.75rem;
                    font-family: inherit;
                    transition: border-color 0.15s ease;

                    &:focus {
                        outline: none;
                        border-color: var(--accent);
                    }

                    &::placeholder {
                        color: var(--muted);
                    }
                }
            }

            .footer {
                margin-top: auto;
                padding-top: 2rem;
            }
        }
    }
}
