:root {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --border: #2a2a2a;
    --text-primary: #f0f0f0;
    --text-muted: #888;
    --accent: #e8c547;
    --accent-hover: #f0d060;
    --danger: #e05555;
    --success: #4caf7d;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

/* ─── Header: Fixed relative logo position & prominent sizing ─── */
header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.lang-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    width: auto;
    transition: all 0.2s;
    margin-top: 4px;
    z-index: 5;
}

.lang-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background-color: var(--surface); /* keep text readable (generic button:hover would paint it gold) */
}

.brand-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
    direction: ltr !important; /* Logo stays strictly on the left of title in ALL languages */
    flex-direction: row !important;
}

.brand-logo {
    height: 64px; /* Prominent size for impactful visual hierarchy */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(232, 197, 71, 0.3));
    transition: transform 0.25s ease;
}

.brand-logo:hover {
    transform: scale(1.06);
}

header h1 {
    color: var(--accent);
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

header > p {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin: 4px 0 35px;
    text-align: center;
}

[dir="rtl"] .lang-toggle {
    right: auto;
    left: 0;
}

/* ─── Features ─── */
.features {
    display: flex;
    gap: 20px;
    margin-bottom: 50px;
    justify-content: center;
}

.feature-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    flex: 1;
}

.feature-card h3 {
    margin-top: 0;
}

/* ─── Pricing ─── */
.pricing {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
    align-items: stretch;
}

.pricing-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px 20px;
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, border-color 0.2s;
}

.pricing-card:hover {
    transform: translateY(-4px);
}

/* ── Best-value / Yearly card — premium glow effect ── */
@keyframes goldGlow {
    0%, 100% { box-shadow: 0 0 18px 4px rgba(232, 197, 71, 0.25), 0 0 40px 8px rgba(232, 197, 71, 0.10); }
    50%       { box-shadow: 0 0 28px 8px rgba(232, 197, 71, 0.45), 0 0 60px 16px rgba(232, 197, 71, 0.18); }
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 197, 71, 0.7); }
    60%       { box-shadow: 0 0 0 8px rgba(232, 197, 71, 0); }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

.pricing-card.best-value {
    border-color: var(--accent);
    transform: scale(1.08);
    z-index: 1;
    background: linear-gradient(160deg, #1e1c0f 0%, #1a1a1a 50%, #1c1b0e 100%);
    animation: goldGlow 3s ease-in-out infinite;
}

.pricing-card.best-value:hover {
    transform: scale(1.10) translateY(-4px);
}

/* Shimmer CTA button inside best-value card */
.pricing-card.best-value .select-plan-btn {
    background: linear-gradient(90deg, var(--accent) 0%, #f8e080 40%, var(--accent) 60%, #c8a830 100%);
    background-size: 200% auto;
    animation: shimmer 2.8s linear infinite;
    color: #0f0f0f;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.pricing-card.best-value .select-plan-btn:hover {
    animation-duration: 1.4s;
    opacity: 0.92;
}

.badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent);
    color: var(--bg);
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: bold;
    letter-spacing: 0.06em;
    animation: badgePulse 2s ease-out infinite;
    white-space: nowrap;
}

.price {
    font-size: 2rem;
    font-weight: bold;
    margin: 15px 0;
}

.price span {
    font-size: 1rem;
    color: var(--text-muted);
}

.device-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: auto;
    margin-bottom: 20px;
}

button {
    background-color: var(--accent);
    color: var(--bg);
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

button:hover {
    background-color: var(--accent-hover);
}

.multiple-devices-note {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ─── Modals ─── */
.modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: var(--surface);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    text-align: left;
    position: relative;
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
}

.close-btn:hover {
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 10px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 4px;
    box-sizing: border-box;
}

.error-msg {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 10px;
}

.instructions-box {
    background-color: var(--bg);
    padding: 20px;
    border-radius: 4px;
    border: 1px solid var(--border);
    margin: 20px 0;
}

.ref-code {
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--accent);
}

/* ─── Language Support Section ─── */
.language-support {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 50px;
    text-align: center;
}
.language-support h2 {
    color: var(--accent);
    margin-top: 0;
    font-size: 1.3rem;
}
.lang-subtitle {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 10px;
}
.lang-quote {
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}

/* ─── Download Section ─── */
.download-section {
    background-color: var(--surface);
    border: 2px dashed var(--accent);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 50px;
}
.download-section h2 {
    margin-top: 0;
    color: var(--text-primary);
}
.download-subtitle {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 20px;
}
.download-box {
    max-width: 400px;
    margin: 0 auto;
}
.download-btn {
    font-size: 1.1rem;
    padding: 15px;
    margin-bottom: 10px;
}
.download-stats {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* ─── Site Footer ─── */
.site-footer {
    margin-top: 60px;
    padding-bottom: 20px;
}
.footer-divider {
    height: 1px;
    background-color: var(--border);
    margin-bottom: 20px;
    opacity: 0.6;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 15px;
}
.contact-btn-footer {
    background-color: rgba(232, 197, 71, 0.05);
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: inline-block;
}
.contact-btn-footer:hover {
    background-color: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

/* ─── RTL overrides ─── */
[dir="rtl"] {
    font-family: 'IBM Plex Sans Arabic', 'IBM Plex Sans', sans-serif;
}
[dir="rtl"] body {
    font-size: 1.05rem;
}
[dir="rtl"] .features {
    flex-direction: row-reverse;
}
[dir="rtl"] .pricing {
    flex-direction: row-reverse;
}
[dir="rtl"] .modal-content {
    text-align: right;
}
[dir="rtl"] .close-btn {
    right: auto;
    left: 20px;
}
[dir="rtl"] .form-group label {
    text-align: right;
}
[dir="rtl"] .footer-content {
    flex-direction: row-reverse;
}

/* ─── Mobile ─── */
@media (max-width: 640px) {
    .container {
        padding: 20px 16px;
    }
    /* Language toggle sits in its own row above the brand instead of over the title */
    .lang-toggle {
        position: static;
        align-self: flex-end;
        margin: 0 0 16px;
    }
    [dir="rtl"] .lang-toggle {
        align-self: flex-start;
    }
    .brand-container {
        gap: 12px;
    }
    .brand-logo {
        height: 48px;
    }
    header h1 {
        font-size: 2rem;
    }
    header > p {
        font-size: 1rem;
        margin-bottom: 28px;
    }
    /* Stack cards instead of squeezing three columns into a phone width */
    .features,
    .pricing,
    [dir="rtl"] .features,
    [dir="rtl"] .pricing {
        flex-direction: column;
        gap: 14px;
    }
    .features {
        margin-bottom: 36px;
    }
    .footer-content,
    [dir="rtl"] .footer-content {
        flex-direction: column;
        gap: 12px;
    }
}
