:root {
    --bg: #f5f8fa;
    --card: #ffffff;
    --line: #e9ecef;
    --text: #212529;
    --muted: #6c757d;
    --primary: #1f6c73;
    --primary-hover: #18575c;
    --primary-soft: #e8f4f5;
    --header-border: #e9ecef;
    --shadow: 0 0.125rem 0.5rem rgba(31, 108, 115, 0.08);
    --radius: 0.625rem;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

html, body {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

a { color: inherit; text-decoration: none; }

.wrap {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding-bottom: env(safe-area-inset-bottom);
}

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--header-border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 18px;
    color: var(--text);
    white-space: nowrap;
}

.brand img {
    height: 40px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border-radius: 999px;
    background: #f3f6f7;
    border: 1px solid var(--line);
    flex-shrink: 0;
}

.lang-switch__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--muted);
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.lang-switch__btn:hover {
    color: var(--primary);
}

.lang-switch__btn.is-active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(31, 108, 115, 0.22);
}

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

@media (min-width: 721px) {
    .header-main {
        flex: 1;
    }

    .lang-switch {
        margin-inline-start: auto;
        margin-inline-end: 4px;
    }
}

.btn {
    border: 0;
    cursor: pointer;
    border-radius: var(--radius);
    padding: 10px 18px;
    font-weight: 700;
    font-size: 15px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    text-align: center;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.btn-ghost {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--line);
}

.btn-ghost:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

.hero {
    padding: 28px 0 28px;
}

.hero-banner {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    min-height: 280px;
    box-shadow: var(--shadow);
}

.hero-banner img {
    display: block;
    width: 100%;
    height: 380px;
    object-fit: cover;
    object-position: center;
}

.hero-banner__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: 32px 36px;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.4) 52%, rgba(15, 23, 42, 0.08) 100%);
    color: #fff;
    text-align: start;
}

.hero h1 {
    font-size: clamp(26px, 6vw, 42px);
    line-height: 1.4;
    margin-bottom: 12px;
    font-weight: 800;
    color: #fff;
    max-width: 18ch;
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    max-width: 520px;
    margin: 0 0 22px;
}

html[dir="rtl"] .hero-banner__content {
    align-items: flex-start;
    background: linear-gradient(to left, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.4) 52%, rgba(15, 23, 42, 0.08) 100%);
}

@media (max-width: 767px) {
    .hero-banner img {
        height: 420px;
        object-position: 70% center;
    }

    .hero-banner__content {
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.55) 100%);
        padding: 24px 20px;
        align-items: flex-start;
    }

    html[dir="rtl"] .hero-banner__content {
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.55) 100%);
    }

    .hero h1 {
        max-width: none;
    }
}

.features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 8px 0 36px;
}

.feature {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-size: 20px;
    margin-bottom: 12px;
    font-weight: 800;
}

.feature h3 { margin-bottom: 8px; font-size: 18px; font-weight: 700; }
.feature p { color: var(--muted); }

.pricing,
.support {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 22px;
    text-align: center;
    margin-bottom: 28px;
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0 4px;
}

.price-amount {
    font-size: clamp(40px, 12vw, 56px);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    color: var(--primary);
}

.price-period {
    font-size: 18px;
    color: var(--muted);
    font-weight: 700;
}

.plan-title {
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 4px;
}

.plan-list {
    list-style: none;
    color: var(--muted);
    margin: 16px auto 20px;
    max-width: 420px;
    text-align: start;
}

.plan-list li {
    padding: 8px 0;
    position: relative;
    padding-inline-start: 22px;
}

.plan-list li::before {
    content: "✓";
    position: absolute;
    inset-inline-start: 0;
    color: var(--primary);
    font-weight: 800;
}

#paypal-button-container {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    min-height: 48px;
}

.paypal-pay-btn {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 12px auto 0;
}

.coupon-box {
    max-width: 420px;
    margin: 16px auto 8px;
    text-align: start;
}

.coupon-box label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.coupon-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.coupon-row input {
    flex: 1 1 160px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 16px;
}

.coupon-msg {
    min-height: 1.4em;
    margin-top: 6px;
    font-size: 14px;
}

.coupon-applied {
    color: var(--primary);
    font-weight: 700;
    margin: 0 auto 12px;
    max-width: 420px;
}

.note, .flash {
    margin-top: 14px;
    color: var(--muted);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.flash-error { color: #dc3545; }
.flash-ok { color: var(--primary); }

.renew-page {
    padding-top: 28px;
}

.expire-alert {
    background: #fff5f5;
    border: 1px solid #f1c0c0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 22px;
    text-align: center;
    margin-bottom: 24px;
}

.expire-alert h1 {
    color: #b42318;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
}

.expire-alert p {
    color: #7a2e2a;
    margin-bottom: 18px;
    font-size: 16px;
}

.expire-alert .btn-primary {
    min-width: min(320px, 100%);
}

.expire-alert--soon {
    background: #fff8eb;
    border-color: #f0c36d;
}

.expire-alert--soon h1 {
    color: #9a6700;
}

.expire-alert--soon p {
    color: #7a5800;
}

.nav-actions form {
    margin: 0;
}

.support h2 { font-size: 24px; margin-bottom: 8px; font-weight: 800; }
.support p { color: var(--muted); margin-bottom: 16px; }

.support-mail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    background: var(--primary-soft);
    border: 1px solid rgba(31, 108, 115, 0.22);
    color: var(--primary);
    border-radius: var(--radius);
    padding: 12px 18px;
    font-weight: 700;
    font-size: 16px;
    direction: ltr;
    overflow-wrap: anywhere;
}

footer {
    padding: 8px 0 calc(28px + env(safe-area-inset-bottom));
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

footer a { color: var(--primary); font-weight: 700; }

@media (max-width: 900px) {
    .features { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .wrap { width: calc(100% - 24px); }

    .site-header .wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .header-main {
        width: 100%;
        justify-content: space-between;
    }

    .brand { font-size: 16px; }

    .nav-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .nav-support { display: none; }

    .nav-actions .btn {
        width: 100%;
        padding: 12px 10px;
        font-size: 14px;
    }

    .hero { padding: 28px 0 18px; }

    .hero h1 { font-size: 26px; }

    .hero p { font-size: 15px; }

    .hero .btn-primary {
        width: 100%;
        max-width: 360px;
    }

    .feature { min-height: 0; padding: 18px; }

    .pricing, .support {
        padding: 22px 16px;
    }

    .price-amount { font-size: 42px; }
    .price-period { width: 100%; font-size: 16px; }
}

@media (max-width: 420px) {
    .hero h1 { font-size: 22px; }
    .price-amount { font-size: 36px; }
    .support-mail { font-size: 15px; }
}
