:root {
    --bg: #f7faff;
    --card: #fff;
    --ink: #0f172a;
    --muted: #667085;
    --border: #e6ebf2;
    --accent: #2563eb;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial
}

.wrap {
    max-width: 1100px;
    margin: auto;
    /*padding: 16px*/
}

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
    padding: 20px
}

.title {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin: 0 0 5px;
    flex-wrap: wrap
}

.title h1 {
    font-size: clamp(20px, 2.5vw, 28px);
    margin: 0;
    font-weight: 800
}

.title .en {
    font-weight: 600;
    color: var(--muted)
}

/* header row */
.grid-head {
    display: grid;
    grid-template-columns:1.2fr repeat(4, 1fr) 1.2fr;
    gap: 10px;
    padding: 10px 12px 14px
}

.grid-head > div {
    text-align: center;
    color: #475467;
    font-weight: 700
}

form {
    display: flex;
    flex-direction: column;
    gap: 24px
}

fieldset.row {
    margin: 0;
    padding: 0 12px;
    border: 0;
    display: grid;
    gap: 12px;
    grid-template-columns:1.2fr repeat(4, 1fr) 1.2fr;
    border-bottom: 1px solid var(--border)
}

fieldset.row:last-of-type {
    border-bottom: none
}

.side {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475467;
    font-weight: bold;
    text-align: center;
    font-size: 20px;
}

legend {
    display: none
}

/* option tiles */
label.option {
    position: relative;
    display: block
}

label.option input {
    position: absolute;
    inset: 0;
    opacity: 0
}

.tile {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .07);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 10px;
    gap: 8px;
    transition: transform .15s, box-shadow .15s, border-color .15s
}

.tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .12)
}

label.option input:checked + .tile {
    border-color: var(--accent);
    box-shadow: 0 12px 28px rgba(37, 99, 235, .18)
}

.tile img {
    width: 64px;
    height: 64px
}

.cap {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2
}

.cap .ar {
    font-weight: bold;
    font-size: 14px
}

.cap .en {
    color: #667085;
    font-size: 12px
}

.actions {
    display: flex;
    justify-content: center
}

button {
    border: none;
    background: var(--accent);
    color: #fff;
    padding: 14px 22px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .25);
    cursor: pointer
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .grid-head {
        display: none
    }

    fieldset.row {
        grid-template-columns:repeat(2, 1fr);
        padding-inline: 8px
    }

    .side {
        display: none
    }

    legend {
        display: contents;
        margin: 8px 4px 10px;
        font-weight: 900;
    }

    .tile img {
        width: 56px;
        height: 56px
    }

    .cap .ar {
        font-size: 13px
    }
}

@media (max-width: 500px) {
    fieldset.row {
        grid-template-columns:repeat(1, 1fr)
    }

    .tile {
        padding: 20px
    }
}

@media screen and (max-width: 900px) {
    .tile {
        padding: 4px 10px;
    }

    .tile img {
        width: 46px;
        height: 46px;
    }

    fieldset.row {
        padding: 0 12px 8px;
    }

    form {
        gap: 16px
    }
}

.toast-message {
    white-space: pre-line;
}

.tile {
    padding: 0 10px;
}

.tile img {
    width: 35px;
    height: 35px;
}

fieldset.row {
    padding: 0 12px 0;
}

form {
    gap: 16px
}
