:root {
    --ink: #071326;
    --muted: #5a687a;
    --line: #d9e3f0;

    --blue: #0b51c5;
    --blue-dark: #001f5f;

    --green: #2fa65a;
    --green-dark: #168344;
    --green-soft: #eefaf2;
    --green-selected: #dcf8e7;

    --red: #ef4444;
    --red-dark: #dc2626;
    --red-soft: #fff0f0;
    --red-selected: #ffe1e1;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: linear-gradient(160deg, #f8fbff, #edf4fb);
    font-family: "Source Sans Pro", "Open Sans", "Segoe UI", Arial, sans-serif;
}

[dir="rtl"] {
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

button {
    font: inherit;
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.hidden {
    display: none !important;
}


/* =========================================
   PHONE SHELL
========================================= */

.phone-shell {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;

    display: grid;
    grid-template-rows: auto 1fr;

    background: #fff;

    box-shadow:
        0 0 0 1px var(--line),
        0 24px 70px rgba(11, 35, 72, .16);
}


/* =========================================
   HEADER
========================================= */

.phone-header {
    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
    padding: 14px 22px 8px;
}

.phone-header img {
    width: 188px;
    max-width: calc(100% - 96px);
}

.logout-btn {
    min-height: 34px;
    padding: 0 12px;

    position: relative;
    overflow: hidden;

    color: var(--blue);
    background: #fff;

    border: 1px solid #c9d8ec;
    border-radius: 6px;

    font-size: 13px;
    font-weight: 800;

    box-shadow: 0 8px 18px rgba(11, 81, 197, .08);

    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        color .18s ease;
}

.logout-btn:hover {
    color: var(--blue-dark);
    border-color: #d9b327;

    transform: translateY(-1px);

    box-shadow:
        0 12px 22px rgba(35, 59, 120, .13);
}


/* =========================================
   VIEW
========================================= */

.view {
    min-width: 0;

    padding: 22px 24px 28px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
}

.view>* {
    width: 100%;
    max-width: 382px;
}

.eyebrow {
    margin: 0 0 6px;

    color: var(--muted);
    font-weight: 700;

    font-family: "Cairo", sans-serif;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}


/* =========================================
   WELCOME
========================================= */

.welcome-view h1 {
    margin: 0;
    font-size: 28px;
}

.login-copy {
    max-width: 320px;

    margin: 0 auto 5px;

    color: var(--ink);

    font-size: 17px;
    font-weight: 700;

    line-height: 1.45;
}

.login-copy.ar {
    font-family: "Cairo", sans-serif;

    color: var(--muted);

    font-size: 15px;
    font-weight: 600;
}

.welcome-name {
    max-width: 90%;

    margin: 18px auto 10px;
    padding: 12px 16px;

    color: #122b4a;

    background: #f7faff;

    border: 1px solid #dce8f7;
    border-radius: 12px;

    font-family: "Cairo", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;

    line-height: 1.8;

    text-align: center;
    direction: rtl;

    box-shadow:
        0 4px 12px rgba(20, 60, 110, 0.05);
}

.welcome-id {
    display: inline-block;

    width: auto;
    max-width: 220px;

    margin: 4px auto 0;
    padding: 7px 14px;

    color: #61728a;

    background: #eef5ff;

    border: 1px solid #cddff5;
    border-radius: 20px;

    font-size: .82rem;
    font-weight: 600;
}


/* =========================================
   ID BADGE
========================================= */

.id-badge {
    width: 92px;
    max-width: 92px;
    height: 92px;

    margin: 34px auto 24px;

    display: grid;
    place-items: center;

    color: var(--blue);

    background:
        linear-gradient(180deg,
            #f7fbff,
            #eaf2ff);

    border: 1px solid #bdd2f0;
    border-radius: 50%;

    box-shadow:
        inset 0 0 0 9px #fff,
        0 18px 38px rgba(11, 81, 197, .12);
}

.id-badge span {
    width: 34px;
    height: 26px;

    position: relative;

    border: 3px solid currentColor;
    border-radius: 7px;
}

.id-badge span::before {
    content: "";

    position: absolute;

    left: 5px;
    top: -23px;

    width: 15px;
    height: 22px;

    border: 3px solid currentColor;
    border-bottom: 0;

    border-radius: 16px 16px 0 0;
}


/* =========================================
   ID FORM
========================================= */

.id-form {
    display: grid;

    gap: 12px;

    justify-items: center;

    margin-top: 22px;
}

.id-form input {
    width: 100%;
    max-width: 260px;
    height: 58px;

    color: var(--ink);
    background: #fff;

    border: 1px solid #c9d8ec;
    border-radius: 8px;

    box-shadow:
        inset 0 2px 8px rgba(20, 54, 99, .06);

    font-size: 28px;
    font-weight: 800;

    letter-spacing: 8px;
    text-align: center;

    outline: 0;
}

.id-form input:focus {
    border-color: var(--blue);

    box-shadow:
        0 0 0 4px rgba(11, 81, 197, .12);
}

.error-text {
    display: none;

    color: var(--red);

    font-weight: 800;
}

.error-text.visible {
    display: block;
}


/* =========================================
   BALLOT
========================================= */

.ballot-art {
    position: relative;

    width: 156px;
    max-width: 156px;
    height: 132px;

    margin: 42px auto 38px;
}

.ballot-art i {
    position: absolute;

    left: 18px;
    right: 18px;
    bottom: 0;

    height: 70px;

    background:
        linear-gradient(180deg,
            #2b73db,
            #0f50bb);

    clip-path:
        polygon(10% 0,
            90% 0,
            100% 22%,
            100% 100%,
            0 100%,
            0 22%);
}

.ballot-art span {
    position: absolute;
    z-index: 2;

    left: 50%;
    top: 0;

    width: 58px;
    height: 72px;

    display: grid;
    place-items: center;

    color: var(--blue);

    background: #fff;

    border: 2px solid #bdd2f0;
    border-radius: 5px;

    transform: translateX(-50%);

    font-size: 30px;
    font-weight: 900;
}


/* =========================================
   BUTTONS
========================================= */

.primary-btn,
.secondary-btn {
    min-height: 54px;

    width: 100%;
    max-width: 340px;

    position: relative;
    overflow: hidden;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 10px;

    border-radius: 6px;

    font-weight: 800;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        filter .18s ease,
        border-color .18s ease,
        color .18s ease;
}

.primary-btn {
    color: #fff;

    background:
        linear-gradient(180deg,
            #1767e3,
            #0642ad);

    border: 0;
    border-bottom: 3px solid #d9b327;

    box-shadow:
        0 14px 28px rgba(11, 81, 197, .24);
}

.secondary-btn {
    color: var(--blue);

    background:
        linear-gradient(180deg,
            #fff,
            #f7f9fc);

    border: 1px solid #b8cbea;

    box-shadow:
        0 8px 18px rgba(35, 59, 120, .08);
}

.primary-btn:hover,
.secondary-btn:hover {
    transform: translateY(-1px);

    filter: saturate(1.06);

    box-shadow:
        0 16px 28px rgba(26, 85, 156, .28);
}

.secondary-btn:hover {
    color: var(--blue-dark);

    border-color: #d9b327;
}

.primary-btn:active,
.secondary-btn:active,
.logout-btn:active,
.choice-btn:active {
    transform: translateY(0);
}


/* =========================================
   QUESTION
========================================= */

.question-view {
    justify-content: flex-start;
    padding-top: 14px;
}

.question-top {
    margin-bottom: 22px;
}

.question-top strong {
    display: block;
    margin-bottom: 12px;
}

.progress-line {
    height: 4px;

    overflow: hidden;

    background: #dce5f1;

    border-radius: 999px;
}

.progress-line span {
    display: block;

    height: 100%;
    width: 20%;

    background: var(--blue);
}

.question-view h2 {
    margin: 0 0 16px;

    direction: rtl;

    font-family: "Cairo", sans-serif;

    font-size: 16px;
    line-height: 1.38;

    max-height: none;

    overflow: visible;

    padding-inline: 4px;
}

.question-view h2 p {
    margin: 0 0 10px;
}

.question-view h2 ul {
    margin: 10px auto 0;

    padding: 0 20px 0 0;
}

.question-view h2 li {
    margin: 0 0 4px;

    font-size: 13px;
    line-height: 1.34;

    text-align: right;
}

.question-points {
    margin: 12px auto 0;

    padding: 0 22px 0 0;

    text-align: right;

    font-size: 14px;
    line-height: 1.65;
}

.question-points li {
    margin-bottom: 4px;
}

.question-view p {
    max-width: 310px;

    margin: 0 auto 32px;

    color: var(--ink);

    font-size: 17px;
    line-height: 1.55;
}


/* =========================================
   ANSWER LIST
========================================= */

.choice-list {
    display: grid;

    gap: 12px;

    margin-bottom: 18px;
}


/* =========================================
   ANSWER BUTTON
========================================= */

.choice-btn {
    min-height: 68px;

    position: relative;
    overflow: hidden;

    display: grid;

    /*
       icon | Arabic | English
    */
    grid-template-columns: 34px 1fr auto;

    align-items: center;

    gap: 12px;

    padding: 11px 18px;

    text-align: left;

    border: 2px solid;

    border-radius: 7px;

    background: #fff;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        background .18s ease,
        border-color .18s ease;
}

.choice-btn:hover {
    transform: translateY(-1px);

    box-shadow:
        0 14px 22px rgba(35, 59, 120, .11);
}

.choice-btn span {
    width: 30px;
    height: 30px;

    display: grid;
    place-items: center;

    color: #fff;

    border-radius: 50%;

    font-size: 20px;
    font-weight: 900;

    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.choice-btn strong {
    align-self: center;

    font-family: "Cairo", sans-serif;

    font-size: 16px;

    transition:
        color .18s ease;
}

.choice-btn small {
    grid-column: auto;

    align-self: center;

    font-size: 13px;

    font-weight: 700;

    transition:
        color .18s ease;
}


/* =========================================
   APPROVE
========================================= */

.choice-btn.yes {
    color: var(--green);

    border-color: rgba(47, 166, 90, .45);

    background: var(--green-soft);
}

.choice-btn.yes span {
    background: var(--green);
}


/* =========================================
   NOT APPROVED
========================================= */

.choice-btn.no {
    color: var(--red);

    border-color: rgba(239, 68, 68, .45);

    background: var(--red-soft);
}

.choice-btn.no span {
    background: var(--red);
}


/* =========================================
   ⭐ SELECTED ANSWER
========================================= */

.choice-btn.selected {
    position: relative;

    transform: translateY(-2px);

    border-width: 3px;

    font-weight: 800;

    z-index: 1;
}


/* =========================================
   SELECTED - APPROVE
========================================= */

.choice-btn.yes.selected {
    color: var(--green-dark);

    background: var(--green-selected);

    border-color: var(--green);

    box-shadow:
        0 0 0 4px rgba(47, 166, 90, .16),
        0 10px 26px rgba(47, 166, 90, .20);
}

.choice-btn.yes.selected span {
    background: var(--green-dark);

    transform: scale(1.12);

    box-shadow:
        0 0 0 4px rgba(47, 166, 90, .16);
}

.choice-btn.yes.selected strong,
.choice-btn.yes.selected small {
    color: var(--green-dark);
}


/* =========================================
   SELECTED - NOT APPROVED
========================================= */

.choice-btn.no.selected {
    color: var(--red-dark);

    background: var(--red-selected);

    border-color: var(--red);

    box-shadow:
        0 0 0 4px rgba(239, 68, 68, .16),
        0 10px 26px rgba(239, 68, 68, .20);
}

.choice-btn.no.selected span {
    background: var(--red-dark);

    transform: scale(1.12);

    box-shadow:
        0 0 0 4px rgba(239, 68, 68, .16);
}

.choice-btn.no.selected strong,
.choice-btn.no.selected small {
    color: var(--red-dark);
}


/* =========================================
   SELECTED CHECK / CROSS
========================================= */

.choice-btn.selected span {
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, .75);

    font-size: 21px;
}


/* =========================================
   BEHALF BLOCK
========================================= */

.behalf-block {
    margin: 2px 0 18px;

    padding: 14px;

    border: 1px solid #c9d8ec;

    border-radius: 8px;

    background:
        linear-gradient(180deg,
            #f8fbff,
            #eef5ff);
}

.behalf-title {
    display: grid;

    gap: 2px;

    margin-bottom: 12px;

    text-align: left;
}

.behalf-title strong {
    color: var(--blue);

    font-size: 15px;
}

.behalf-title small {
    color: var(--muted);

    font-weight: 800;

    font-family: "Cairo", sans-serif;
}

.behalf-choice-list {
    margin-bottom: 0;
}


/* =========================================
   SUBMITTED / THANK YOU
========================================= */

.submitted-view {
    gap: 18px;
}

.success-mark {
    width: 104px;
    max-width: 104px;
    height: 104px;

    margin: 0 auto 8px;

    display: grid;
    place-items: center;

    color: #fff;

    background:
        linear-gradient(180deg,
            #49c56f,
            #218d47);

    border-radius: 50%;

    font-size: 62px;
    font-weight: 900;

    box-shadow:
        0 18px 34px rgba(47, 166, 90, .25);
}

.submitted-view h1 {
    margin: 0;
}

.submitted-view p {
    max-width: 290px;

    margin: 0 auto 26px;

    color: var(--ink);

    line-height: 1.55;
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 520px) {

    .phone-shell {
        min-height: 100svh;

        max-width: none;

        margin: 0;

        box-shadow: none;
    }

    .choice-btn {
        min-height: 72px;

        grid-template-columns: 36px 1fr auto;

        padding: 12px 14px;

        gap: 10px;
    }

    .choice-btn strong {
        font-size: 16px;
    }

    .choice-btn small {
        font-size: 12px;
    }

    .choice-btn span {
        width: 32px;
        height: 32px;
    }

    .choice-btn.yes.selected,
    .choice-btn.no.selected {
        transform: translateY(-2px);
    }
}


/* =========================================
   ACCESSIBILITY / REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* =========================================
   THANK YOU / WAITING
========================================= */

.submitted-view {
    min-height: 520px;

    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    text-align: center;

    padding: 40px 24px;
}


/* =========================================
   SUCCESS ICON
========================================= */

.success-mark {
    width: 110px;
    height: 110px;

    margin: 0 auto 24px;

    display: grid;
    place-items: center;

    color: #fff;

    background:
        linear-gradient(180deg,
            #49c56f,
            #218d47);

    border-radius: 50%;

    font-size: 64px;
    font-weight: 900;

    box-shadow:
        0 18px 40px rgba(47, 166, 90, .25);
}


/* =========================================
   WAITING
========================================= */

.waiting-message {
    width: 100%;
    max-width: 330px;

    margin: 30px auto 0;

    padding: 22px 18px;

    display: flex;
    flex-direction: column;

    align-items: center;

    gap: 8px;

    background: #f7faff;

    border: 1px solid #dce8f7;

    border-radius: 14px;

    box-shadow:
        0 8px 24px rgba(20, 60, 110, .07);
}

.waiting-message strong {
    color: #17345d;

    font-size: 15px;

    line-height: 1.5;
}

.waiting-message small {
    color: #61728a;

    font-family: "Cairo", sans-serif;

    font-size: 14px;

    line-height: 1.6;
}


/* =========================================
   WAITING DOTS
========================================= */

.waiting-icon {
    display: flex;

    align-items: center;

    gap: 6px;

    margin-bottom: 8px;
}

.waiting-icon span {
    width: 8px;
    height: 8px;

    display: block;

    background: #0b51c5;

    border-radius: 50%;

    animation: waitingDots 1.4s infinite ease-in-out;
}

.waiting-icon span:nth-child(1) {
    animation-delay: 0s;
}

.waiting-icon span:nth-child(2) {
    animation-delay: .2s;
}

.waiting-icon span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes waitingDots {

    0%,
    80%,
    100% {
        opacity: .3;
        transform: scale(.8);
    }

    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}


/* =========================================
   ARABIC THANK YOU
========================================= */

.thank-you-ar {
    margin: 4px 0 0;

    color: #5a687a;

    font-family: "Cairo", sans-serif;

    font-size: 16px;

    line-height: 1.8;
}


/* =========================================
   FINAL THANK YOU
========================================= */

#finalThankYou {
    width: 100%;
    max-width: 360px;

    text-align: center;
}

#finalThankYou h1 {
    margin: 10px 0 8px;

    color: #122b4a;

    font-size: 27px;

    font-weight: 800;
}

#finalThankYou>p {
    margin: 8px auto;

    color: #5a687a;

    font-size: 15px;

    line-height: 1.6;
}


/* =========================================
   FINAL CHECK ICON
========================================= */

.final-check {
    width: 72px;
    height: 72px;

    margin: 0 auto 12px;

    display: grid;
    place-items: center;

    color: #fff;

    background: #2fa65a;

    border-radius: 50%;

    font-size: 40px;
    font-weight: 900;

    box-shadow:
        0 12px 28px rgba(47, 166, 90, .22);
}


/* =========================================
   FINAL MESSAGE
========================================= */

.final-message {
    width: 100%;

    margin-top: 24px;
    padding: 20px 18px;

    display: flex;
    flex-direction: column;

    gap: 8px;

    background: #f7faff;

    border: 1px solid #dce8f7;

    border-radius: 14px;
}

.final-message strong {
    color: #17345d;

    font-size: 14px;

    line-height: 1.5;
}

.final-message span {
    color: #61728a;

    font-size: 14px;

    line-height: 1.6;
}

.final-message span[dir="rtl"] {
    font-family: "Cairo", sans-serif;
}

h1 {
    font-family: "Cairo", sans-serif;
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 520px) {

    .submitted-view {
        min-height: 500px;

        padding: 32px 20px;
    }

    .success-mark {
        width: 96px;
        height: 96px;

        font-size: 56px;
    }

    #finalThankYou h1 {
        font-size: 24px;
    }
}