/* ---------------------------------------------------------------------------
   Terms & Conditions (terms.jsp + terms-fa.jsp).

   Loaded after index.css / public-polish.css, so it uses that token family
   (--bg-primary, --card-bg, --text-*, --accent-*, --polish-*).
--------------------------------------------------------------------------- */

.terms-hero {
    position: relative;
    overflow: hidden;
    background: var(--polish-hero-grad, linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)));
    color: #fff;
    padding: 7rem 0 8rem;
    text-align: center;
}

.terms-hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    margin: 1rem 0 0.85rem;
}

.terms-hero p {
    max-width: 760px;
    margin: 0 auto;
    font-size: 1.12rem;
    opacity: 0.94;
}

.terms-section {
    padding: 4rem 0;
    background: var(--bg-primary);
}

.terms-container {
    max-width: 940px;
}

.terms-updated {
    color: var(--text-secondary);
    margin: 0 0 1rem;
    font-weight: 600;
}

.terms-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--polish-radius-md, 16px);
    box-shadow: var(--polish-shadow-lg, 0 14px 38px var(--shadow));
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.terms-card h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    letter-spacing: 0;
    margin: 2rem 0 0.7rem;
}

.terms-card h2:first-child {
    margin-top: 0;
}

.terms-card p {
    color: var(--text-secondary);
    line-height: 1.85;
    margin: 0;
}

.terms-card a {
    color: var(--accent-primary);
    font-weight: 700;
    text-decoration: none;
}

.terms-card a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* The phone number is marked dir="ltr" in the markup; isolate it so the
   surrounding Persian sentence can't reorder the digits. */
.terms-card a[href^="tel:"] {
    unicode-bidi: isolate;
    white-space: nowrap;
}

/* --- RTL / Persian typography -------------------------------------------
   Alignment already follows dir="rtl" (text-align defaults to start), so the
   only things worth setting are the type details: public-polish.css tightens
   every h1-h3 by -0.02em, which cramps joined Persian glyphs, and Persian
   needs a taller line for its ascenders/descenders.
------------------------------------------------------------------------- */

[dir="rtl"] .terms-hero h1,
[dir="rtl"] .terms-card h2 {
    letter-spacing: normal;
    word-spacing: 0.02em;
}

[dir="rtl"] .terms-card p,
[dir="rtl"] .terms-hero p {
    line-height: 2.05;
}

[dir="rtl"] .terms-card h2 {
    margin-top: 2.25rem;
}

@media (max-width: 640px) {
    .terms-hero {
        padding: 5rem 0 6.5rem;
    }

    .terms-section {
        padding: 2.75rem 0;
    }

    .terms-card p {
        line-height: 1.8;
    }

    [dir="rtl"] .terms-card p {
        line-height: 1.95;
    }
}
