/*
|--------------------------------------------------------------------------
| Sauqly V2 — Country Selection Page
|--------------------------------------------------------------------------
*/

/*
|--------------------------------------------------------------------------
| Page
|--------------------------------------------------------------------------
*/

.country-selection-body {
    min-inline-size: 320px;
    min-block-size: 100vh;
    min-block-size: 100svh;

    margin: 0;
    overflow-x: hidden;
}

.country-page {
    position: relative;
    isolation: isolate;

    min-block-size: 100vh;
    min-block-size: 100svh;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 50% 40%,
            rgba(10, 29, 99, 0.05) 0,
            transparent 36%
        ),
        linear-gradient(
            180deg,
            var(--color-page) 0%,
            var(--color-surface-soft) 100%
        );
}

html[data-theme="dark"] .country-page {
    background:
        radial-gradient(
            circle at 50% 42%,
            rgba(255, 121, 0, 0.075) 0,
            transparent 38%
        ),
        linear-gradient(
            180deg,
            #020b1d 0%,
            #03152f 100%
        );
}

/*
|--------------------------------------------------------------------------
| Main Container
|--------------------------------------------------------------------------
|
| Fluid Tailwind-style container.
| لا يوجد max-width أو width ثابت.
|
*/

.country-page__container {
    position: relative;
    z-index: 5;

    display: flex;
    justify-content: center;
    flex-direction: column;

    inline-size: 100%;
    min-block-size: 100vh;
    min-block-size: 100svh;

    margin-inline: auto;
    padding:
        1.5rem
        var(--container-padding-inline);
}

/*
|--------------------------------------------------------------------------
| Side Dots
|--------------------------------------------------------------------------
*/

.country-background {
    position: absolute;
    top: 29%;
    z-index: 0;

    inline-size: clamp(7rem, 12vw, 12rem);
    block-size: clamp(15rem, 34vh, 21rem);

    opacity: 0.11;
    pointer-events: none;

    background-image:
        radial-gradient(
            circle,
            var(--color-accent) 1.25px,
            transparent 1.6px
        );

    background-size: 20px 20px;
}

.country-background--start {
    inset-inline-start: -2rem;
}

.country-background--end {
    inset-inline-end: -2rem;
}

html[data-theme="dark"] .country-background {
    opacity: 0.09;
}

/*
|--------------------------------------------------------------------------
| Header
|--------------------------------------------------------------------------
*/

.country-header {
    position: relative;
    z-index: 50;

    margin-bottom: 20px;

    direction: ltr;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;

    inline-size: 100%;
    min-block-size: 4.5rem;
}

.country-header__side {
    display: flex;
    align-items: center;

    min-inline-size: 0;
}

.country-header__side--start {
    justify-content: flex-start;
}

.country-header__side--end {
    justify-content: flex-end;
}

/*
|--------------------------------------------------------------------------
| Brand
|--------------------------------------------------------------------------
*/

.country-brand {
    position: relative;
    z-index: 51;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-inline: auto;

    line-height: 0;
    pointer-events: auto;
}

.country-brand__image {
    display: block;

    inline-size: clamp(11rem, 17vw, 18rem);
    block-size: auto;

    object-fit: contain;
}

.country-brand__image--dark {
    display: none;
}

html[data-theme="dark"] .country-brand__image--light {
    display: none;
}

html[data-theme="dark"] .country-brand__image--dark {
    display: block;
}

/*
|--------------------------------------------------------------------------
| Header Actions
|--------------------------------------------------------------------------
*/

.country-header__actions {
    position: relative;
    z-index: 60;

    display: flex;
    align-items: center;
    gap: 0.55rem;

    pointer-events: auto;
}

.country-language-button,
.country-theme-button {
    position: relative;
    z-index: 61;

    pointer-events: auto;
    user-select: none;
}

.country-language-button {
    padding-inline: 1rem;
}

.country-language-button__text--arabic {
    font-family: var(--font-arabic);
    font-weight: 700;
    letter-spacing: 0;
}

.country-language-button__text--english {
    font-family: var(--font-english);
    font-weight: 600;
    letter-spacing: 0;
}

.country-theme-icon--sun {
    display: none;
}

html[data-theme="dark"] .country-theme-icon--moon {
    display: none;
}

html[data-theme="dark"] .country-theme-icon--sun {
    display: inline-block;
}

/*
|--------------------------------------------------------------------------
| Main Content
|--------------------------------------------------------------------------
*/

.country-content {
    display: flex;
    /* flex: 1; */
    flex-direction: column;
    align-items: center;

    inline-size: 100%;

    margin-inline: auto;
    padding-block-start: 0.2rem;

    text-align: center;
}

/*
|--------------------------------------------------------------------------
| Heading
|--------------------------------------------------------------------------
*/

.country-heading {
    position: relative;
    z-index: 4;

    inline-size: min(100%, 48rem);
    margin-inline: auto;
}

.country-heading__eyebrow {
    margin: 0 0 0.25rem;

    color: var(--color-accent);

    font-size: clamp(0.8rem, 0.9vw, 1rem);
    font-weight: 500;
    line-height: 1.5;
}

.country-heading__title {
    margin: 0;

    color: var(--color-primary);

    font-size: clamp(2rem, 2.9vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
}

html[lang="ar"] .country-heading__title {
    font-size: clamp(2rem, 2.85vw, 2.95rem);
    line-height: 1.42;
    letter-spacing: 0;
}

html[lang="en"] .country-heading__title {
    font-size: clamp(2.1rem, 3vw, 3.1rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -1px;
}

html[data-theme="dark"] .country-heading__title {
    color: #ffffff;
}

.country-heading__description {
    inline-size: min(100%, 40rem);
    margin: 0.35rem auto 0;

    color: var(--color-text-muted);

    font-size: clamp(0.85rem, 1vw, 1.05rem);
    font-weight: 400;
    line-height: 1.65;
}

/*
|--------------------------------------------------------------------------
| Globe
|--------------------------------------------------------------------------
*/

.country-globe {
    position: relative;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    inline-size: 100%;
    block-size: clamp(18rem, 43vh, 27rem);

    margin:
        1rem
        0
        -0.75rem;

    overflow: visible;
}

.country-globe__aura {
    position: absolute;
    top: 50%;
    left: 50%;

    inline-size: clamp(28rem, 48vw, 48rem);
    aspect-ratio: 1;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(255, 121, 0, 0.14) 0,
            rgba(255, 121, 0, 0.06) 34%,
            rgba(10, 29, 99, 0.04) 52%,
            transparent 73%
        );

    transform: translate(-50%, -50%);

    pointer-events: none;
}

html[data-theme="light"] .country-globe__aura {
    background:
        radial-gradient(
            circle,
            rgba(10, 29, 99, 0.10) 0,
            rgba(10, 29, 99, 0.035) 36%,
            transparent 72%
        );
}

.country-globe__image {
    position: relative;
    z-index: 3;

    display: block;

    inline-size: clamp(19rem, 34vw, 31rem);
    block-size: auto;

    object-fit: contain;

    scale: clamp(1.08, 1.2, 1.32);
    transform-origin: center bottom;

    animation:
        country-globe-floating 6s ease-in-out infinite;

    will-change: transform;
}

.country-globe__image--dark {
    display: none;
}

html[data-theme="dark"] .country-globe__image--light {
    display: none;
}

html[data-theme="dark"] .country-globe__image--dark {
    display: block;
}

.country-globe__shadow {
    position: absolute;
    left: 50%;
    bottom: 0.5rem;
    z-index: 2;

    inline-size: clamp(16rem, 30vw, 25rem);
    block-size: clamp(2.5rem, 5vw, 3.5rem);

    background:
        radial-gradient(
            ellipse at center,
            rgba(255, 121, 0, 0.28) 0%,
            rgba(255, 121, 0, 0.14) 46%,
            rgba(255, 121, 0, 0) 78%
        );

    border-radius: var(--radius-pill);

    filter: blur(15px);
    opacity: 1;

    transform: translateX(-50%);

    pointer-events: none;
}

html[data-theme="light"] .country-globe__shadow {
    background:
        radial-gradient(
            ellipse at center,
            rgba(10, 29, 99, 0.20) 0%,
            rgba(10, 29, 99, 0.09) 46%,
            rgba(10, 29, 99, 0) 78%
        );
}

@keyframes country-globe-floating {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

/*
|--------------------------------------------------------------------------
| Form
|--------------------------------------------------------------------------
*/

.country-form {
    position: relative;
    z-index: 5;

    inline-size: 100%;
}

.country-form__error {
    inline-size: min(100%, 35rem);
    margin: 0 auto 0.875rem;
}

/*
|--------------------------------------------------------------------------
| Country Grid
|--------------------------------------------------------------------------
*/

.country-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: center;
    gap: clamp(0.65rem, 1.2vw, 0.9rem);

    inline-size: min(100%, 46rem);
    margin-inline: auto;
}

/*
|--------------------------------------------------------------------------
| Country Card
|--------------------------------------------------------------------------
*/

.country-card {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    inline-size: 100%;
    min-inline-size: 0;

    aspect-ratio: 1.08 / 1;
    padding:
        clamp(0.8rem, 1.4vw, 1rem)
        clamp(0.65rem, 1vw, 0.8rem);

    color: #ffffff;

    background:
        linear-gradient(
            180deg,
            rgba(10, 28, 54, 0.72) 0%,
            rgba(7, 22, 44, 0.82) 100%
        );

    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025),
        0 8px 24px rgba(0, 0, 0, 0.13);

    cursor: pointer;
    outline: none;

    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);

    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        box-shadow 180ms ease;
}

html[data-theme="dark"] .country-card {
    background:
        linear-gradient(
            180deg,
            rgba(10, 28, 54, 0.78) 0%,
            rgba(7, 22, 44, 0.90) 100%
        );

    border-color: rgba(255, 255, 255, 0.13);

    box-shadow:
        0 13px 34px rgba(0, 0, 0, 0.2);
}

.country-card:hover {
    border-color: rgba(255, 121, 0, 0.62);

    background:
        linear-gradient(
            180deg,
            rgba(13, 34, 64, 0.82) 0%,
            rgba(8, 25, 49, 0.92) 100%
        );

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(255, 121, 0, 0.08);

    transform: translateY(-3px);
}

.country-card:focus-visible {
    border-color: var(--color-accent);

    box-shadow:
        0 0 0 4px var(--color-accent-soft),
        var(--shadow-sm);
}

.country-card.is-selected {
    border-color: var(--color-accent);

    background:
        linear-gradient(
            180deg,
            rgba(20, 43, 73, 0.92) 0%,
            rgba(10, 29, 55, 0.96) 100%
        );

    box-shadow:
        0 0 0 2px rgba(255, 121, 0, 0.14),
        0 12px 30px rgba(0, 0, 0, 0.2);

    transform: translateY(-3px);
}

/*
|--------------------------------------------------------------------------
| Selected Check
|--------------------------------------------------------------------------
*/

.country-card__check {
    position: absolute;
    top: 0.65rem;
    inset-inline-end: 0.65rem;

    display: flex;
    align-items: center;
    justify-content: center;

    inline-size: 1.4rem;
    aspect-ratio: 1;

    color: #ffffff;
    background: var(--color-accent);

    border-radius: 50%;

    font-size: 0.7rem;

    opacity: 0;

    transform: scale(0.65);

    transition:
        opacity var(--transition-fast),
        transform var(--transition-fast);
}

.country-card.is-selected .country-card__check {
    opacity: 1;

    transform: scale(1);
}

/*
|--------------------------------------------------------------------------
| Flag
|--------------------------------------------------------------------------
*/

.country-card__flag {
    display: flex;
    align-items: center;
    justify-content: center;

    inline-size: min(70%, 6.5rem);
    aspect-ratio: 1.6 / 1;

    margin-block-end: 0.45rem;
}

.country-card__flag img {
    display: block;

    inline-size: auto;
    max-inline-size: 100%;
    max-block-size: 100%;

    object-fit: contain;

    border-radius: 6px;

    filter:
        drop-shadow(
            0 5px 8px rgba(0, 0, 0, 0.22)
        );

    transition:
        transform 180ms ease;
}

.country-card:hover .country-card__flag img,
.country-card.is-selected .country-card__flag img {
    transform: scale(1.035);
}

/*
|--------------------------------------------------------------------------
| Country Name
|--------------------------------------------------------------------------
*/

.country-card__name {
    inline-size: 100%;
    margin: 0;

    overflow: hidden;

    color: #ffffff;

    font-size: clamp(0.75rem, 1.1vw, 0.875rem);
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[lang="ar"] .country-card__name {
    font-family: var(--font-arabic);
    font-weight: 600;
}

html[lang="en"] .country-card__name {
    font-family: var(--font-english);
    font-weight: 400;
}

/*
|--------------------------------------------------------------------------
| Card Arrow
|--------------------------------------------------------------------------
*/

.country-card__arrow {
    display: flex;
    align-items: center;
    justify-content: center;

    inline-size: 100%;
    block-size: 1.1rem;

    margin-block-start: 0.45rem;

    color: var(--color-accent);

    font-size: 0.875rem;
    line-height: 1;
}

.country-card__arrow i {
    display: block;

    transition:
        transform 180ms ease;
}

.country-card:hover .country-card__arrow i {
    transform: translateY(2px);
}

.country-card.is-selected .country-card__arrow i {
    transform: rotate(180deg);
}

/*
|--------------------------------------------------------------------------
| Actions
|--------------------------------------------------------------------------
*/

.country-actions {
    display: flex;
    flex-direction: column;
    align-items: center;

    inline-size: 100%;

    margin:
        1.4rem
        auto
        0;
}

.country-continue-button {
    inline-size: auto;
    min-block-size: 52px;

    padding-inline: clamp(3rem, 7vw, 5rem);

    margin-inline: auto;
}

/*
|--------------------------------------------------------------------------
| Loader
|--------------------------------------------------------------------------
*/

.country-continue-button__loader {
    position: relative;
    z-index: 3;

    display: none;

    inline-size: 1.35rem;
    aspect-ratio: 1;

    border: 3px solid rgba(255, 255, 255, 0.38);
    border-top-color: #ffffff;
    border-radius: 50%;

    animation:
        country-button-loader 700ms linear infinite;
}

.country-continue-button.is-loading
.v2-primary-button__label,
.country-continue-button.is-loading
.v2-primary-button__icon {
    display: none;
}

.country-continue-button.is-loading
.country-continue-button__loader {
    display: block;
}

@keyframes country-button-loader {
    to {
        transform: rotate(360deg);
    }
}

/*
|--------------------------------------------------------------------------
| Security Note
|--------------------------------------------------------------------------
*/

.country-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;

    margin: 0.7rem 0 0;

    color: var(--color-text-muted);

    font-size: 0.7rem;
    line-height: 1.55;
    text-align: center;
}

.country-security-note i {
    flex-shrink: 0;

    color: var(--color-accent);

    font-size: 0.8rem;
}

/*
|--------------------------------------------------------------------------
| Bottom Orbits
|--------------------------------------------------------------------------
*/

.country-corner-orbit {
    position: absolute;
    bottom: -12rem;
    z-index: 1;

    inline-size: clamp(15rem, 23vw, 20rem);
    aspect-ratio: 1;

    border: 1px solid var(--color-accent);
    border-radius: 50%;

    opacity: 0.42;

    pointer-events: none;
}

.country-corner-orbit::before {
    content: "";

    position: absolute;
    top: 12%;

    inline-size: 0.8rem;
    aspect-ratio: 1;

    background: var(--color-accent);

    border-radius: 50%;
}

.country-corner-orbit--start {
    inset-inline-start: -11rem;
}

.country-corner-orbit--start::before {
    inset-inline-end: 15%;
}

.country-corner-orbit--end {
    inset-inline-end: -11rem;
}

.country-corner-orbit--end::before {
    inset-inline-start: 15%;
}

html[data-theme="dark"] .country-corner-orbit {
    opacity: 0.26;
}

/*
|--------------------------------------------------------------------------
| Tablet
|--------------------------------------------------------------------------
*/

@media (max-width: 900px) {
    .country-header {
        min-block-size: 4rem;
    }

    .country-brand__image {
        inline-size: clamp(9.5rem, 22vw, 12rem);
    }

    .country-content {
        padding-block-start: 0.9rem;
    }

    .country-globe {
        block-size: clamp(16rem, 36vh, 20rem);

        margin-block-end: 0.8rem;
    }

    .country-globe__image {
        inline-size: clamp(17rem, 48vw, 23rem);
        /* scale: 1.2; */
        scale: 1;
    }

    .country-globe__aura {
        inline-size: clamp(24rem, 65vw, 30rem);
    }

    .country-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        inline-size: min(100%, 36rem);
    }
}

/*
|--------------------------------------------------------------------------
| Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 767px) {
    .country-page {
        overflow: visible;
    }

    .country-background,
    .country-corner-orbit {
        display: none;
    }

    .country-page__container {
        min-block-size: auto;

        padding-block:
            0.8rem
            1.6rem;
    }

    .country-header {
        display: flex;
        align-items: center;
        justify-content: space-between;

        min-block-size: 3rem;
    }

    .country-header__side--start {
        display: none;
    }

    .country-brand {
        margin-inline: 0;
    }

    .country-brand__image {
        inline-size: clamp(7.5rem, 38vw, 9rem);
    }

    .country-header__actions {
        gap: 0.4rem;
    }

    .country-language-button {
        aspect-ratio: 1;
        padding: 0;
    }

    .country-language-button span {
        display: none;
    }

    .country-content {
        padding-block-start: 1rem;
    }

    .country-heading {
        inline-size: min(100%, 22rem);
    }

    .country-heading__eyebrow {
        display: none;
    }

    .country-heading__title,
    html[lang="ar"] .country-heading__title,
    html[lang="en"] .country-heading__title {
        font-size: 1.8rem;
    }

    .country-heading__description {
        inline-size: min(100%, 20rem);

        margin-block-start: 0.3rem;

        font-size: 0.8rem;
        line-height: 1.6;
    }

    .country-globe {
        block-size: clamp(13rem, 30vh, 15rem);

        margin:
            0.5rem
            0
            0.9rem;
    }

    .country-globe__image {
        inline-size: clamp(13rem, 67vw, 16rem);

        scale: 1.16;
       margin-bottom: -95px;
    }

    .country-globe__aura {
        inline-size: clamp(17rem, 80vw, 20rem);
    }

    .country-globe__shadow {
        inline-size: min(55vw, 12rem);
        block-size: 1.8rem;
    }

    .country-grid {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;

        inline-size: 100%;
    }

    .country-card {
        display: grid;
        grid-template-columns:
            auto
            minmax(0, 1fr)
            auto;
        align-items: center;

        inline-size: 100%;
        aspect-ratio: auto;

        min-block-size: 4.75rem;

        padding:
            0.55rem
            0.75rem;

        border-radius: 15px;

        transform: none;
    }

    .country-card:hover,
    .country-card.is-selected {
        transform: none;
    }

    .country-card__check {
        top: 0.4rem;
        inset-inline-end: 0.4rem;

        inline-size: 1.2rem;
    }

    .country-card__flag {
        inline-size: 3.5rem;
        block-size: 2.6rem;
        aspect-ratio: auto;

        margin: 0;
    }

    .country-card__flag img {
        max-inline-size: 100%;
        max-block-size: 100%;
    }

    .country-card__name,
    html[lang="en"] .country-card__name {
        margin: 0;
        padding-inline: 0.75rem;

        font-size: 0.9rem;
        text-align: start;
    }

    .country-card__arrow {
        inline-size: auto;
        block-size: auto;

        margin: 0;

        padding-inline-start: 0.35rem;
    }

    .country-card__arrow i {
        transform: rotate(-90deg);
    }

    html[dir="rtl"] .country-card__arrow i {
        transform: rotate(-270deg);
    }

    .country-card:hover .country-card__arrow i,
    .country-card.is-selected .country-card__arrow i {
        transform: rotate(90deg);
    }

    html[dir="rtl"]
    .country-card:hover
    .country-card__arrow i,
    html[dir="rtl"]
    .country-card.is-selected
    .country-card__arrow i {
        transform: rotate(-90deg);
    }

    .country-actions {
        margin-block-start: 1rem;
    }

    .country-continue-button {
        inline-size: 100%;
        min-block-size: 52px;

        padding-inline: 1.5rem;
    }

    .country-security-note {
        margin-block-start: 0.65rem;

        font-size: 0.68rem;
    }
}

/*
|--------------------------------------------------------------------------
| Short Desktop Screens
|--------------------------------------------------------------------------
*/

@media (min-width: 901px) and (max-height: 820px) {
    .country-page__container {
        padding-block:
            1rem
            0.9rem;
    }

    .country-header {
        min-block-size: 3.7rem;
    }

    .country-brand__image {
        inline-size: clamp(10.5rem, 15vw, 13rem);
    }

    .country-content {
        padding-block-start: 0;
    }

    .country-heading__eyebrow {
        margin-block-end: 0.12rem;

        font-size: 1.1rem;
    }

    .country-heading__title,
    html[lang="ar"] .country-heading__title,
    html[lang="en"] .country-heading__title {
        font-size: 2rem;
        font-weight: 500;
    }

    .country-heading__description {
        margin-block-start: 0.2rem;

        font-size: 0.875rem;
    }

    .country-globe {
        block-size: clamp(17rem, 40vh, 20rem);

        margin:
            -1rem
            0
            -3rem;
    }

    .country-globe__image {
        top: 2rem;

        inline-size: clamp(19rem, 32vw, 23rem);

        scale: 1;
    }

    .country-globe__aura {
        top: calc(50% + 2rem);

        inline-size: clamp(25rem, 42vw, 30rem);
    }

    .country-globe__shadow {
        bottom: 5rem;

        inline-size: min(38vw, 25rem);
        block-size: 3.5rem;

        background:
            radial-gradient(
                ellipse at center,
                rgba(255, 121, 0, 0.24) 0%,
                rgba(255, 121, 0, 0.12) 48%,
                rgba(255, 121, 0, 0) 78%
            );

        filter: blur(14px);
    }

    html[data-theme="light"] .country-globe__shadow {
        background:
            radial-gradient(
                ellipse at center,
                rgba(10, 29, 99, 0.18) 0%,
                rgba(10, 29, 99, 0.08) 48%,
                rgba(10, 29, 99, 0) 78%
            );
    }

    .country-form {
        margin-block-start: 0.35rem;
    }

    .country-card {
        min-block-size: 8.5rem;

        padding:
            0.7rem
            0.85rem;
    }

    .country-card__flag {
        max-block-size: 3.5rem;
    }

    .country-card__name {
        margin-block-start: 0.3rem;
    }

    .country-actions {
        margin-block-start: 0.9rem;
    }

    .country-continue-button {
        min-block-size: 50px;

        padding-inline: clamp(3rem, 6vw, 4.25rem);
    }

    .country-security-note {
        margin-block-start: 0.45rem;
    }
}

/*
|--------------------------------------------------------------------------
| Reduced Motion
|--------------------------------------------------------------------------
*/

@media (prefers-reduced-motion: reduce) {
    .country-globe__image {
        animation: none;
    }
}