:root {
    --brand: #6d0167;
    --brand-dark: #450044;
    --brand-soft: #f7edf7;
    --accent: #a70b9e;
    --blue: #2563eb;
    --green: #168a53;
    --red: #d52b3f;
    --amber: #c27803;
    --ink: #211f26;
    --muted: #706a76;
    --line: #e8e2ea;
    --surface: #ffffff;

    --page-top: #f9fbfd;
    --page-bottom: #e8eef5;
    --step-pending: #64748b;
    --step-pending-bg: #f1f5f9;
    --step-done: #15803d;
    --step-done-bg: #e9f8ef;
    --step-active: #672583;
    --step-active-dark: #47165e;

    --shadow: 0 22px 65px rgba(43, 31, 49, .13);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--page-bottom);
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 28px 16px;
    color: var(--ink);
    font-family: Vazir, Tahoma, Arial, sans-serif;
    direction: rtl;
    background:
        radial-gradient(
            circle at 12% 8%,
            rgba(103, 37, 131, .11),
            transparent 31%
        ),
        radial-gradient(
            circle at 88% 15%,
            rgba(2, 132, 199, .09),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            var(--page-top) 0%,
            var(--page-bottom) 100%
        );
    background-attachment: fixed;
}

button,
input,
select,
textarea {
    font: inherit;
}

.reserve-shell {
    width: min(100%, 760px);
    margin: 0 auto;
}

.reserve-shell.reserve-shell--compact {
    width: min(100%, 560px);
}

/* ----------------------------------------
   کارت برند و لوگو
----------------------------------------- */

.brand-card {
    display: flex;
    min-height: 126px;
    align-items: center;
    gap: 16px;
    margin-bottom: 15px;
    padding: 10px 18px;
    overflow: hidden;
    border: 1px solid rgba(103, 37, 131, .15);
    border-radius: 22px;
    color: var(--ink);
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 16px 42px rgba(30, 41, 59, .09);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/*
 * لوگو داخل یک قاب ثابت نمایش داده می‌شود.
 * خود تصویر با لایه ::before کمی زوم می‌شود تا حاشیه سفید
 * و گوشه‌های اضافه فایل icon.png دیده نشوند.
 */
.brand-mark.brand-mark--site-logo {
    --logo-zoom: 1.20;

    position: relative !important;
    inset: auto !important;
    isolation: isolate;

    display: block !important;
    flex: 0 0 82px !important;

    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;

    height: 82px !important;
    min-height: 82px !important;
    max-height: 82px !important;

    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;

    border: 0 !important;
    border-radius: 23px !important;

    background: #6d0167 !important;
    box-shadow: 0 10px 25px rgba(109, 1, 103, .18) !important;
    transform: none !important;
}

.brand-mark.brand-mark--site-logo::before {
    content: "";

    position: absolute;
    z-index: 1;
    inset: 0;

    border-radius: inherit;

    background-image: url("/icon.png?v=20260805-32");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: contain;

    transform: scale(var(--logo-zoom));
    transform-origin: center center;

    pointer-events: none;
}

/* محتوای قدیمی داخل لوگو نمایش داده نشود. */
.brand-mark.brand-mark--site-logo img,
.brand-mark.brand-mark--site-logo svg {
    display: none !important;
}

/* جلوگیری از نمایش icon.png خارج از کادر لوگو */
.brand-card > img[src^="/icon.png"],
.reserve-shell > img[src^="/icon.png"],
body > img[src^="/icon.png"] {
    display: none !important;
}

/* استایل لوگوی SVG قدیمی، فقط اگر صفحه‌ای هنوز کلاس جدید را ندارد */
.brand-mark:not(.brand-mark--site-logo) {
    display: grid;
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    place-items: center;
    border-radius: 16px;
    color: var(--brand);
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}

.brand-mark:not(.brand-mark--site-logo) svg {
    width: 29px;
    height: 29px;
}

.brand-copy {
    min-width: 0;
}

.brand-copy strong {
    display: block;
    color: #2d2034;
    font-size: 17px;
    line-height: 1.8;
}

.brand-copy span {
    display: block;
    color: #716578;
    font-size: 12px;
    line-height: 1.9;
}

/* ----------------------------------------
   مراحل ثبت‌نام
----------------------------------------- */

.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.step {
    position: relative;
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 8px;
    overflow: hidden;
    border: 1px solid #dce4ec;
    border-radius: 15px;
    color: var(--step-pending);
    text-align: center;
    font-size: 11.5px;
    font-weight: 800;
    background: var(--step-pending-bg);
    box-shadow: 0 7px 18px rgba(51, 65, 85, .055);
    transition:
        transform .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}

.step::before {
    content: "";
    display: block;
    flex: 0 0 9px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: currentColor;
    opacity: .55;
}

.step.is-done {
    border-color: #b9e4c8;
    color: var(--step-done);
    background: var(--step-done-bg);
}

.step.is-done::before {
    content: "✓";
    display: grid;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    place-items: center;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    background: var(--step-done);
    opacity: 1;
}

.step.is-active {
    z-index: 2;
    border-color: #7b3898;
    color: #fff;
    background:
        linear-gradient(
            135deg,
            #7a3996 0%,
            var(--step-active-dark) 100%
        );
    box-shadow:
        0 14px 32px rgba(103, 37, 131, .30),
        0 0 0 4px rgba(103, 37, 131, .09);
    transform: translateY(-2px);
}

.step.is-active::before {
    flex-basis: 11px;
    width: 11px;
    height: 11px;
    background: #fff;
    opacity: 1;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, .15);
}

/* ----------------------------------------
   کارت اصلی
----------------------------------------- */

.reserve-card {
    overflow: hidden;
    border: 1px solid #dce4ec;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card-head {
    padding: 25px 28px 20px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(
            135deg,
            rgba(103, 37, 131, .075),
            rgba(2, 132, 199, .035)
        );
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    background: var(--brand-soft);
}

.card-head h1,
.card-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(20px, 4vw, 27px);
    line-height: 1.65;
}

.card-head p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 2;
}

.card-body {
    padding: 26px 28px 30px;
}

/* ----------------------------------------
   فرم‌ها
----------------------------------------- */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.field {
    min-width: 0;
}

.field.field--full {
    grid-column: 1 / -1;
}

.field label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
    color: #37313c;
    font-size: 13px;
    font-weight: 800;
}

.required {
    color: var(--red);
}

.input-wrap {
    position: relative;
}

.input,
.select {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #dcd4df;
    border-radius: 13px;
    outline: none;
    color: var(--ink);
    background: #fff;
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.input:focus,
.select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(167, 11, 158, .11);
}

.input[readonly],
.input:disabled,
.select:disabled {
    color: #5d5662;
    background: #f4f1f5;
    cursor: not-allowed;
}

.input.ltr {
    direction: ltr;
    text-align: right;
}

.input.center {
    text-align: center;
}

.select {
    appearance: none;
    padding-left: 38px;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236d0167' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
}

.help {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.8;
}

.error {
    display: block;
    margin-top: 6px;
    color: var(--red);
    font-size: 12px;
    line-height: 1.8;
}

/* ----------------------------------------
   پیام‌ها
----------------------------------------- */

.alert {
    margin: 0 0 18px;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 14px;
    font-size: 13px;
    line-height: 2;
}

.alert--danger {
    color: #992034;
    border-color: #f0bcc5;
    background: #fff2f4;
}

.alert--info {
    color: #1f4f9f;
    border-color: #c9dafc;
    background: #f1f6ff;
}

.alert--success {
    color: #12643c;
    border-color: #bde5cf;
    background: #effbf4;
}

.alert--warning {
    color: #875000;
    border-color: #efd6a7;
    background: #fff8e9;
}

/* ----------------------------------------
   خلاصه هزینه
----------------------------------------- */

.summary-card {
    margin-top: 20px;
    padding: 17px;
    border: 1px solid #d8e2ea;
    border-radius: 17px;
    background:
        linear-gradient(180deg, #fcfdff 0%, #f5f8fb 100%);
}

.summary-card h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.summary-card p {
    margin: 0;
    color: #58505d;
    font-size: 12.5px;
    line-height: 2.05;
}

.summary-card strong {
    color: var(--brand);
}

.price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #decfe0;
}

.price-row span {
    color: var(--muted);
    font-size: 12.5px;
}

.price-row strong {
    color: var(--green);
    font-size: 17px;
    white-space: nowrap;
}

/* ----------------------------------------
   قوانین، دکمه‌ها و امنیت
----------------------------------------- */

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 20px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--brand);
}

.checkbox-row label {
    color: #4e4752;
    font-size: 12.5px;
    line-height: 2;
}

.text-link {
    color: var(--blue);
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 23px;
}

.btn {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 20px;
    border: 0;
    border-radius: 13px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 900;
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        opacity .16s ease;
}

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

.btn:disabled {
    opacity: .55;
    cursor: wait;
    transform: none;
}

.btn--primary {
    flex: 1;
    color: #fff;
    background:
        linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 12px 28px rgba(109, 1, 103, .24);
}

.btn--secondary {
    color: var(--brand);
    border: 1px solid #dbc8dc;
    background: #fff;
}

.security-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.8;
}

.security-note svg {
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    color: var(--green);
}

/* ----------------------------------------
   مودال
----------------------------------------- */

.modal-backdrop {
    position: fixed;
    z-index: 999;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(24, 0, 23, .72);
    backdrop-filter: blur(5px);
}

.modal-backdrop.is-open {
    display: flex;
}

.modal {
    width: min(100%, 760px);
    max-height: 88vh;
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .34);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 21px;
    border-bottom: 1px solid var(--line);
}

.modal-head h3 {
    margin: 0;
    color: var(--brand);
    font-size: 18px;
}

.modal-close {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: #665d69;
    background: #f4f0f5;
    cursor: pointer;
}

.modal-body {
    max-height: calc(88vh - 74px);
    overflow: auto;
    padding: 20px 23px 25px;
    color: #49414d;
    font-size: 13px;
    line-height: 2.15;
}

.modal-body p {
    margin: 0 0 10px;
}

.term-number {
    color: var(--red);
    font-weight: 900;
}

/* ----------------------------------------
   صفحه نتیجه پرداخت
----------------------------------------- */

.result-wrap {
    text-align: center;
}

.result-icon {
    display: grid;
    width: 96px;
    height: 96px;
    place-items: center;
    margin: 0 auto 12px;
    border-radius: 24px;
}

.result-icon svg {
    width: 42px;
    height: 42px;
}

.result-icon--success {
    color: #087746;
    background: #eaf9f1;
}

.result-icon--danger {
    color: #bd1f38;
    background: #fff0f3;
}

.result-icon--info {
    color: #2058aa;
    background: #edf4ff;
}

.result-title {
    margin: 0;
    font-size: 23px;
    line-height: 1.7;
}

.result-text {
    max-width: 520px;
    margin: 10px auto 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 2.1;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
    text-align: right;
}

.detail-item {
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #faf8fb;
}

.detail-item span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.detail-item strong {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: #312b34;
    font-size: 13px;
}

/* ----------------------------------------
   انیمیشن
----------------------------------------- */

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    to {
        opacity: .25;
        transform: scale(.75);
    }
}

/* ----------------------------------------
   موبایل و تبلت
----------------------------------------- */

@media (max-width: 720px) {
    body {
        padding: 14px 10px 24px;
    }

    .brand-card {
        min-height: 104px;
        gap: 12px;
        padding: 9px 13px;
        border-radius: 18px;
    }

    /*
     * زوم موبایل کمتر از دسکتاپ است تا متن لوگو بریده نشود.
     */
    .brand-mark.brand-mark--site-logo {
        --logo-zoom: 1.27;

        flex: 0 0 84px !important;

        width: 84px !important;
        min-width: 84px !important;
        max-width: 84px !important;

        height: 84px !important;
        min-height: 84px !important;
        max-height: 84px !important;

        border-radius: 18px !important;
    }

    .brand-copy strong {
        font-size: 14px;
    }

    .brand-copy span {
        font-size: 11px;
    }

    .steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .step {
        min-height: 50px;
        padding: 9px 4px;
        font-size: 10.5px;
    }

    .step.is-active {
        transform: none;
    }

    .reserve-card {
        border-radius: 18px;
    }

    .card-head {
        padding: 20px 18px 16px;
    }

    .card-body {
        padding: 20px 17px 23px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .field.field--full {
        grid-column: auto;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .price-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .brand-card {
        min-height: 91px;
        gap: 10px;
        padding: 8px 11px;
    }

    /*
     * در گوشی‌های باریک، زوم باز هم کمتر شده تا کراپ رخ ندهد.
     */
    .brand-mark.brand-mark--site-logo {
        --logo-zoom: 1.16;

        flex: 0 0 72px !important;

        width: 72px !important;
        min-width: 72px !important;
        max-width: 72px !important;

        height: 72px !important;
        min-height: 72px !important;
        max-height: 72px !important;

        border-radius: 16px !important;
    }

    .brand-copy strong {
        font-size: 13px;
    }

    .brand-copy span {
        font-size: 10.5px;
        line-height: 1.8;
    }

    .step {
        padding: 8px 3px;
        font-size: 10px;
    }
}
