/* Customer billing guide (landing page) */

.guide-page {
    --guide-success: #1f9d6b;
    --guide-success-bg: #e7f7f0;
    --guide-danger: #d6455d;
    --guide-danger-bg: #fdecef;
    --guide-warning: #b7791f;
    --guide-warning-bg: #fff6e5;
    --guide-sticky-top: 88px;
}

html[data-theme="dark"] .guide-page {
    --guide-success-bg: rgba(31, 157, 107, 0.16);
    --guide-danger-bg: rgba(214, 69, 93, 0.16);
    --guide-warning-bg: rgba(183, 121, 31, 0.18);
    --guide-warning: #f0b45b;
}

/* Action bar */
.guide-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--es-surface);
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-lg);
    box-shadow: var(--es-shadow);
    padding: 1.25rem 1.5rem;
}

.guide-actions-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.guide-actions-text strong {
    color: var(--es-heading);
    font-size: 1.1rem;
}

.guide-actions-text span,
.guide-actions-hint {
    color: var(--es-text-muted);
    font-size: 0.9rem;
}

.guide-actions-hint {
    flex-basis: 100%;
}

.guide-actions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.guide-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    padding: 0.55rem 1.2rem;
    font-weight: 700;
    border: 1px solid var(--es-navy);
    color: var(--es-navy);
    background: transparent;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.guide-btn:hover,
.guide-btn:focus-visible {
    background: var(--es-navy);
    color: #fff;
    transform: translateY(-1px);
}

.guide-btn.is-primary {
    background: var(--es-navy);
    color: #fff;
}

.guide-btn.is-primary:hover,
.guide-btn.is-primary:focus-visible {
    background: var(--es-navy-dark);
}

html[data-theme="dark"] .guide-btn {
    border-color: var(--es-orange);
    color: var(--es-orange);
}

html[data-theme="dark"] .guide-btn.is-primary,
html[data-theme="dark"] .guide-btn:hover {
    background: var(--es-orange);
    color: #0a1014;
}

/* Table of contents: sticky column on desktop, scrollable chips on mobile */
.guide-toc {
    position: sticky;
    top: var(--guide-sticky-top);
    background: var(--es-surface);
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-lg);
    padding: 1rem;
    max-height: calc(100vh - var(--guide-sticky-top) - 1rem);
    overflow-y: auto;
}

.guide-toc-title {
    color: var(--es-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    padding-inline: 0.5rem;
}

.guide-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.guide-toc a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--es-radius);
    color: var(--es-text);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.guide-toc a i {
    font-size: 1.2rem;
    color: var(--es-mint);
}

.guide-toc a:hover,
.guide-toc a.is-active {
    background: var(--es-mint-light);
    color: var(--es-navy);
}

html[data-theme="dark"] .guide-toc a:hover,
html[data-theme="dark"] .guide-toc a.is-active {
    color: var(--es-orange);
}

.guide-toc a.is-active i {
    color: inherit;
}

@media (max-width: 991.98px) {
    .guide-page {
        --guide-sticky-top: 72px;
    }

    .guide-toc-col {
        position: sticky;
        top: var(--guide-sticky-top);
        z-index: 50;
    }

    .guide-toc {
        position: static;
        padding: 0.5rem;
        max-height: none;
        overflow: visible;
        border-radius: var(--es-radius);
        box-shadow: var(--es-shadow);
    }

    .guide-toc-title {
        display: none;
    }

    .guide-toc ul {
        display: flex;
        gap: 0.35rem;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .guide-toc ul::-webkit-scrollbar {
        display: none;
    }

    .guide-toc a {
        white-space: nowrap;
        padding: 0.4rem 0.8rem;
        border-radius: 999px;
        font-size: 0.9rem;
        border: 1px solid var(--es-border);
    }

    .guide-section {
        scroll-margin-top: calc(var(--guide-sticky-top) + 72px) !important;
    }
}

/* Content */
.guide-intro {
    color: var(--es-text-muted);
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

.guide-section {
    background: var(--es-surface);
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-lg);
    box-shadow: 0 10px 30px 5px rgba(72, 209, 237, 0.06);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    scroll-margin-top: calc(var(--guide-sticky-top) + 12px);
}

.guide-section-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.guide-section-head h2 {
    color: var(--es-heading);
    font-size: clamp(1.3rem, 2.6vw, 1.6rem);
    font-weight: 800;
    margin: 0;
}

.guide-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    background: var(--es-mint-light);
    color: var(--es-navy);
    font-size: 1.6rem;
}

html[data-theme="dark"] .guide-section-icon {
    color: var(--es-orange);
}

.guide-body {
    color: var(--es-text);
    line-height: 1.9;
}

.guide-body h3 {
    color: var(--es-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 1.75rem 0 0.75rem;
    padding-inline-start: 0.75rem;
    border-inline-start: 4px solid var(--es-orange);
}

.guide-body ul,
.guide-body ol:not(.guide-flow) {
    padding-inline-start: 1.25rem;
}

.guide-body li {
    margin-bottom: 0.35rem;
}

.guide-body li::marker {
    color: var(--es-mint);
}

.guide-body strong {
    color: var(--es-heading);
}

.guide-body hr {
    border-color: var(--es-border);
    opacity: 1;
}

/* Tables */
.guide-table {
    overflow-x: auto;
    margin: 1rem 0 1.25rem;
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius);
    -webkit-overflow-scrolling: touch;
}

.guide-table table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.guide-table th,
.guide-table td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--es-border);
    text-align: start;
    vertical-align: middle;
}

.guide-table th[align="right"],
.guide-table td[align="right"] {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.guide-table thead th {
    background: var(--es-surface-alt);
    color: var(--es-heading);
    font-weight: 700;
    white-space: nowrap;
}

.guide-table tbody tr:last-child td {
    border-bottom: 0;
}

.guide-table tbody tr:hover td {
    background: var(--es-surface-alt);
}

.guide-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.guide-badge.is-success {
    background: var(--guide-success-bg);
    color: var(--guide-success);
}

.guide-badge.is-danger {
    background: var(--guide-danger-bg);
    color: var(--guide-danger);
}

/* Calculation boxes */
.guide-calc {
    background: var(--es-surface-alt);
    border: 1px dashed var(--es-mint);
    border-radius: var(--es-radius);
    padding: 1rem 1.25rem;
    margin: 1rem 0 1.25rem;
    white-space: pre-wrap;
    direction: rtl;
    text-align: start;
}

.guide-calc code {
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--es-navy);
    line-height: 2;
}

html[data-theme="dark"] .guide-calc code {
    color: var(--es-orange);
}

/* Callouts */
.guide-callout {
    border-radius: var(--es-radius);
    padding: 0.9rem 1.1rem;
    margin: 1rem 0 1.25rem;
    border-inline-start: 4px solid var(--es-mint);
    background: var(--es-mint-light);
}

.guide-callout p:last-child {
    margin-bottom: 0;
}

.guide-callout.is-warning {
    border-inline-start-color: var(--guide-warning);
    background: var(--guide-warning-bg);
}

/* Step diagrams */
.guide-flow {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.5rem 0 1.5rem;
    padding: 0;
    counter-reset: none;
}

.guide-flow-step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    flex: 1 1 160px;
    background: var(--es-surface-alt);
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius);
    padding: 0.85rem;
    margin: 0;
}

.guide-flow-step:not(:last-child)::after {
    content: '\2190';
    position: absolute;
    inset-inline-end: -0.7rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.4rem;
    height: 1.4rem;
    line-height: 1.4rem;
    text-align: center;
    border-radius: 50%;
    background: var(--es-surface);
    border: 1px solid var(--es-border);
    color: var(--es-mint);
    font-size: 0.85rem;
    z-index: 1;
}

.guide-flow-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--es-navy);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
}

.guide-flow-step strong {
    display: block;
    color: var(--es-heading);
    line-height: 1.5;
}

.guide-flow-step small {
    display: block;
    color: var(--es-text-muted);
    line-height: 1.6;
}

@media (max-width: 767.98px) {
    .guide-flow {
        flex-direction: column;
    }

    .guide-flow-step {
        flex-basis: auto;
    }

    .guide-flow-step:not(:last-child)::after {
        content: '\2193';
        inset-inline-end: auto;
        inset-inline-start: 1.1rem;
        top: auto;
        bottom: -1.05rem;
        transform: none;
    }

    .guide-section {
        padding: 1.25rem;
    }

    .guide-section-icon {
        width: 40px;
        height: 40px;
        font-size: 1.35rem;
    }
}

/* FAQ */
.guide-faq {
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius);
    margin-bottom: 0.6rem;
    background: var(--es-surface);
}

.guide-faq summary {
    cursor: pointer;
    list-style: none;
    padding: 0.9rem 1.1rem;
    font-weight: 700;
    color: var(--es-heading);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.guide-faq summary::-webkit-details-marker {
    display: none;
}

.guide-faq summary::after {
    content: '+';
    font-size: 1.3rem;
    color: var(--es-mint);
    line-height: 1;
}

.guide-faq[open] summary::after {
    content: '\2212';
}

.guide-faq[open] summary {
    border-bottom: 1px solid var(--es-border);
}

.guide-faq-body {
    padding: 0.9rem 1.1rem;
}

.guide-faq-body p:last-child {
    margin-bottom: 0;
}

/* Closing note */
.guide-outro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    background: var(--es-mint-light);
    border-radius: var(--es-radius-lg);
    padding: 1.25rem 1.5rem;
}

.guide-outro > i {
    font-size: 2rem;
    color: var(--es-navy);
}

.guide-outro > div {
    flex: 1 1 240px;
}

.guide-outro p {
    margin: 0;
    font-weight: 500;
    color: var(--es-heading);
}
