/* =========================
   RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* =========================
   VARIABLES
========================= */

:root {
    --background: #f5f5f7;
    --card: #ffffff;
    --text: #1d1d1f;
    --secondary: #6e6e73;
    --border: #d2d2d7;
    --blue: #0071e3;
    --blue-hover: #0077ed;
    --success: #1d9b52;
}


/* =========================
   HTML
========================= */

html {
    scroll-behavior: smooth;
}


/* =========================
   BODY
========================= */

body {
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    background: var(--background);
    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "SF Pro Text",
        "Helvetica Neue",
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
}


/* =========================
   NAVIGATION
========================= */

.navbar {
    width: 100%;
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}


.site-menu {
    position: absolute;
    top: 76px;
    right: 0;
    width: min(360px, 100%);
    background: rgba(22, 22, 23, 0.94);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: -16px 24px 36px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    animation: menuAppear 0.24s ease both;
}


@keyframes menuAppear {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.site-menu-inner {
    width: 100%;
    padding: 20px 0 26px;
}


.menu-search {
    width: calc(100% - 48px);
    height: 44px;
    margin: 0 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
}


.menu-search svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    stroke: rgba(255, 255, 255, 0.8);
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}


.menu-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: white;
    font: inherit;
    font-size: 17px;
}


.site-menu nav {
    padding: 0 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}


.site-menu nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.02em;
}


.site-menu nav a::after {
    content: ">";
    color: rgba(255, 255, 255, 0.52);
    font-size: 20px;
    font-weight: 400;
}


.site-menu nav a:hover,
.site-menu nav a:focus-visible {
    color: #b8d9ff;
}


.menu-button svg {
    overflow: visible;
}


.menu-button.is-active svg {
    transform: none;
}


.menu-button.is-active {
    background: transparent;
    border-radius: 0;
}


.menu-button svg path {
    transform-origin: 12px 12px;
    transition: transform 0.24s ease, opacity 0.24s ease;
}


.menu-button.is-active svg path:first-child {
    transform: translateY(5.5px) rotate(45deg);
}


.menu-button.is-active svg path:nth-child(2) {
    opacity: 0;
}


.menu-button.is-active svg path:last-child {
    transform: translateY(-5.5px) rotate(-45deg);
}


.nav-inner {
    width: min(calc(100% - 48px), 1280px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.nav-top {
    min-height: 76px;
}


.nav-row {
    min-height: 116px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}


.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    padding: 8px 0 0;
    transition: transform 0.2s ease;
}


.brand:hover {
    transform: translateY(-1px);
}


.apple-logo {
    width: 25px;
    height: 30px;
    object-fit: contain;
    transform: translateY(2px);
}


.nav-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}


.icon-button {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #111111;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}


.icon-button svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}


.bag-button svg {
    width: 27px;
    height: 27px;
    stroke-width: 1.8;
}


.icon-button:hover,
.icon-button:focus-visible,
.icon-button.is-active {
    opacity: 0.75;
}


.icon-button:active {
    transform: scale(0.96);
}


.title-group {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding-left: 2px;
}


.section-title {
    font-size: clamp(1.09rem, 1.25vw, 1.77rem);
    line-height: 1.05;
    letter-spacing: -0.065em;
    font-weight: 600;
}


.section-caret {
    font-size: clamp(0.73rem, 0.78vw, 0.99rem);
    line-height: 1;
    color: var(--text);
    transform: translateY(2px);
}


.buy-button {
    border: none;
    background: linear-gradient(180deg, #1a7ef7 0%, #0f6fe6 100%);
    color: white;
    padding: 7px 17px;
    border-radius: 999px;
    font-size: clamp(0.83rem, 0.99vw, 1.20rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    cursor: pointer;
    min-width: 63px;
    box-shadow: 0 4px 9px rgba(19, 115, 232, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}


.buy-button:hover {
    filter: brightness(1.03);
    box-shadow: 0 12px 22px rgba(19, 115, 232, 0.3);
}


.buy-button:active {
    transform: scale(0.98);
}


/* =========================
   MAIN
========================= */

.main {
    flex: 1;

    width: 100%;

    display: flex;
    justify-content: center;

    padding: 70px 20px;
}


/* =========================
   CARD
========================= */

.card {
    width: 100%;
    max-width: 560px;

    background: var(--card);

    border-radius: 28px;

    padding: 48px;

    border:
        1px solid rgba(0, 0, 0, 0.04);

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.08);

    animation:
        cardAppear 0.5s ease both;
}


@keyframes cardAppear {

    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


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

.card-header {
    text-align: center;

    margin-bottom: 38px;
}


.icon-circle {
    width: 255px;
    height: 165px;

    margin: 0 auto 18px;

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

    border-radius: 0;
    background: transparent;
    overflow: visible;
    box-shadow: none;
}


.icon-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: transparent;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.04));
}


.eyebrow {
    margin-bottom: 10px;

    color: var(--secondary);

    font-size: 14px;
    font-weight: 500;
}


h1 {
    font-size:
        clamp(
            28px,
            5vw,
            38px
        );

    line-height: 1.1;

    letter-spacing: -1.3px;

    font-weight: 700;
}


.subtitle {
    max-width: 430px;

    margin: 15px auto 0;

    color: var(--secondary);

    font-size: 16px;

    line-height: 1.5;
}


/* =========================
   INPUT
========================= */

.input-group {
    width: 100%;
}


.input-group label {
    display: block;

    margin-bottom: 9px;

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


.input-wrapper {
    position: relative;
}


.input-wrapper input {
    width: 100%;
    height: 56px;

    padding:
        0 50px 0 16px;

    border:
        1px solid var(--border);

    border-radius: 14px;

    background: white;

    color: var(--text);

    font-size: 16px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.input-wrapper input::placeholder {
    color: #86868b;
}


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

    box-shadow:
        0 0 0 4px
        rgba(0, 113, 227, 0.12);
}


.clear-button {
    position: absolute;

    right: 12px;
    top: 50%;

    transform:
        translateY(-50%);

    width: 30px;
    height: 30px;

    border: none;

    border-radius: 50%;

    background: #e8e8ed;

    color: #555;

    font-size: 20px;

    line-height: 1;

    cursor: pointer;
}


.help-text {
    margin-top: 9px;

    color: var(--secondary);

    font-size: 13px;

    line-height: 1.4;
}


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

.check-button {
    width: 100%;
    height: 56px;

    margin-top: 24px;

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

    gap: 10px;

    border: none;

    border-radius: 14px;

    background: var(--blue);
    color: white;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}


.check-button:hover {
    background: var(--blue-hover);
}


.check-button:active {
    transform: scale(0.985);
}


.check-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}


/* =========================
   SPINNER
========================= */

.spinner {
    width: 19px;
    height: 19px;

    border:
        2px solid
        rgba(255, 255, 255, 0.4);

    border-top-color: white;

    border-radius: 50%;

    animation:
        spin 0.7s linear infinite;
}


@keyframes spin {

    to {
        transform: rotate(360deg);
    }

}


/* =========================
   RESULT
========================= */

.result {
    margin-top: 28px;

    padding: 30px 20px;

    text-align: center;

    border-radius: 20px;

    background: #f6fdf8;

    border:
        1px solid
        rgba(29, 155, 82, 0.15);

    animation:
        resultAppear 0.4s ease both;
}


@keyframes resultAppear {

    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


.result-icon {
    width: 44px;
    height: 44px;

    margin: 0 auto 15px;

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

    border-radius: 50%;

    background: #dff7e8;

    color: var(--success);

    font-size: 22px;
    font-weight: 700;
}


.result-label {
    color: var(--secondary);

    font-size: 14px;
}


.result h2 {
    margin-top: 6px;

    font-size: 30px;

    line-height: 1.2;

    letter-spacing: -0.7px;
}


.result-note {
    margin-top: 10px;

    color: var(--secondary);

    font-size: 13px;

    line-height: 1.5;
}


/* =========================
   LEARN MORE
========================= */

.learn-more {
    margin-top: 28px;

    text-align: center;
}


.learn-more p {
    color: var(--secondary);

    font-size: 13px;
}


.learn-more button {
    border: none;

    background: transparent;

    color: var(--blue);

    font-size: inherit;

    cursor: pointer;
}


.learn-more button:hover {
    text-decoration: underline;
}


/* =========================
   MODAL
========================= */

.modal {
    position: fixed;

    inset: 0;

    z-index: 2000;

    display: flex;

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

    padding: 20px;
}


/*
    IMPORTANT FIX:

    The modal uses display:flex,
    so explicitly override it when
    the HTML hidden attribute exists.
*/

.modal[hidden] {
    display: none !important;
}


.modal-backdrop {
    position: absolute;

    inset: 0;

    background:
        rgba(0, 0, 0, 0.4);

    backdrop-filter: blur(8px);

    -webkit-backdrop-filter: blur(8px);
}


.modal-content {
    position: relative;

    z-index: 1;

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

    padding: 32px;

    background: white;

    border-radius: 22px;

    box-shadow:
        0 30px 80px
        rgba(0, 0, 0, 0.25);

    animation:
        modalAppear 0.25s ease both;
}


@keyframes modalAppear {

    from {
        opacity: 0;

        transform:
            scale(0.96);
    }

    to {
        opacity: 1;

        transform:
            scale(1);
    }

}


.modal-content h2 {
    margin-bottom: 12px;

    font-size: 24px;
}


.modal-content p {
    color: var(--secondary);

    line-height: 1.6;
}


.modal-close {
    position: absolute;

    top: 14px;
    right: 14px;

    width: 32px;
    height: 32px;

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

    border: none;

    border-radius: 50%;

    background: #f2f2f7;

    color: var(--blue);

    font-size: 20px;

    cursor: pointer;
}


/* =========================
   TOAST
========================= */

.toast {
    position: fixed;

    top: 82px;
    left: 50%;

    transform:
        translate(-50%, -20px);

    width:
        min(
            calc(100% - 32px),
            440px
        );

    padding: 14px 16px;

    background: #1d1d1f;

    color: white;

    border-radius: 14px;

    box-shadow:
        0 15px 40px
        rgba(0, 0, 0, 0.2);

    opacity: 0;

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;

    z-index: 3000;
}


.toast.show {
    opacity: 1;

    transform:
        translate(-50%, 0);

    pointer-events: auto;
}


.toast-content {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;
}


.toast button {
    border: none;

    background: transparent;

    color: white;

    font-size: 22px;

    cursor: pointer;
}


/* =========================
   FOOTER
========================= */

.footer {
    padding: 25px 20px;

    text-align: center;

    color: var(--secondary);

    font-size: 13px;
}


.footer-small {
    margin-top: 4px;

    opacity: 0.7;
}


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

@media (max-width: 600px) {

    .site-menu-inner {
        padding: 16px 0 22px;
    }

    .site-menu nav a {
        font-size: 17px;
    }

    .nav-inner {
        width:
            min(
                calc(100% - 28px),
                1100px
            );
    }


    .main {
        padding: 35px 14px;
    }


    .card {
        padding: 32px 20px;

        border-radius: 22px;
    }


    h1 {
        font-size: 30px;
    }


    .subtitle {
        font-size: 15px;
    }


    .result h2 {
        font-size: 26px;
    }


    .modal-content {
        padding: 30px 24px;
    }

}


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

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

    *,
    *::before,
    *::after {

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

        scroll-behavior:
            auto !important;

        transition-duration:
            0.01ms !important;
    }

}