/* ============================================
   M-PESA PAYBILL CHARGES CALCULATOR CSS
   Page-Specific Styles
   ============================================ */

/* ============================================
   1. HERO SECTION
   ============================================ */

.paybill-hero-section {
    position: relative;
    background: linear-gradient(135deg, #004526 0%, #006837 100%);
    padding: 4rem 0 10rem;
    overflow: hidden;
    min-height: 650px;
}

.paybill-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(0, 168, 107, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.paybill-hero-header {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.paybill-hero-title {
    font-size: 3.3rem;
    font-weight: 900;
    color: #ffffff !important;
    margin: 0 0 0.85rem;
    line-height: 1.05;
    letter-spacing: -0.018em;
    text-transform: uppercase;
    display: inline-block;
    transform: rotate(-0.6deg) skewY(-1deg);
    text-shadow: none;
}

.paybill-hero-subtitle-main {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0.4rem 0 1.35rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.paybill-hero-rotate {
    color: #f59e0b;
    font-weight: 700;
    display: inline-block;
    animation: paybillRotateFade 0.5s ease-in-out;
}

@keyframes paybillRotateFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.paybill-hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 900px;
    margin: 0 auto 0.25rem;
    line-height: 1.6;
}

.paybill-hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    width: 100%;
    height: 120px;
    z-index: 1;
}

.paybill-hero-wave svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================================
   2. CALCULATOR BOARD
   ============================================ */

.paybill-calc-board {
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 2.75rem;
    box-shadow: 0 35px 80px rgba(0, 45, 25, 0.25);
    max-width: 920px;
    margin: -1rem auto 0;
    position: relative;
    z-index: 10;
    transform: translateY(8rem);
}

.paybill-calc-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 1rem;
}

.paybill-calc-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.paybill-option-pill {
    position: relative;
    flex: 1 1 220px;
    cursor: pointer;
}

.paybill-option-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.paybill-option-pill span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    border-radius: 999px;
    border: 2px solid rgba(31, 41, 55, 0.08);
    background: rgba(249, 250, 251, 0.9);
    color: #1f2937;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.paybill-option-pill span i {
    color: #004526;
}

.paybill-option-pill input[type="radio"]:checked+span {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(255, 237, 213, 0.45));
    color: #92400e;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.25);
}

.paybill-option-pill input[type="radio"]:checked+span i {
    color: #b45309;
}

.paybill-calc-main {
    margin-bottom: 1.75rem;
}

.paybill-calc-input {
    margin-bottom: 1.5rem;
}

.paybill-calc-input label {
    display: block;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.paybill-calc-input input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    transition: all 0.3s ease;
}

.paybill-calc-input input:focus {
    outline: none;
    border-color: #004526;
    box-shadow: 0 0 0 3px rgba(0, 69, 38, 0.12);
}

.paybill-input-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.paybill-calc-submit {
    width: 100%;
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, #004526 0%, #006837 100%);
    color: #ffffff;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.paybill-calc-submit:hover {
    background: linear-gradient(135deg, #006837 0%, #004526 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 69, 38, 0.35);
}

.paybill-calc-submit:active {
    transform: translateY(0);
}

.paybill-result-card {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.75rem;
    margin-top: 2rem;
}

.paybill-result-head {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid #e5e7eb;
}

.paybill-result-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem;
}

.paybill-result-amount {
    font-size: 2.5rem;
    font-weight: 900;
    color: #004526;
    line-height: 1;
}

.paybill-result-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.paybill-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.6);
}

.paybill-result-row:last-child {
    border-bottom: none;
}

.paybill-result-row span {
    font-size: 0.95rem;
    color: #6b7280;
    font-weight: 500;
}

.paybill-result-row strong {
    font-size: 1.05rem;
    color: #1f2937;
    font-weight: 700;
}

.paybill-result-row--highlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(255, 237, 213, 0.15));
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid rgba(245, 158, 11, 0.2);
    margin: 0.5rem 0;
}

.paybill-result-row--highlight span {
    color: #92400e;
    font-weight: 600;
}

.paybill-result-row--highlight strong {
    color: #b45309;
    font-size: 1.25rem;
}

/* ============================================
   3. RATE TABLE SECTION
   ============================================ */

.rate-table-section {
    padding: 8rem 0 4rem;
    background: #f9fbf7;
}

.rate-table-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.rate-table-heading h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.rate-table-heading p {
    font-size: 1.125rem;
    color: #6b7280;
    max-width: 700px;
    margin: 0 auto;
}

.rate-table-container {
    background: #ffffff;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.rate-table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.rate-table-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.rate-table-tab {
    border: 2px solid rgba(0, 69, 38, 0.12);
    background: #f9fafb;
    color: #1f2937;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rate-table-tab:hover {
    border-color: #004526;
    color: #004526;
}

.rate-table-tab.is-active {
    background: #004526;
    border-color: #004526;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 69, 38, 0.18);
}

.rate-table-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(182, 134, 44, 0.35);
}

.rate-table-updated {
    font-size: 0.875rem;
    font-weight: 600;
    color: #004526;
    background: rgba(0, 69, 38, 0.08);
    padding: 0.5rem 1rem;
    border-radius: 999px;
}

.rate-table-note {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
}

.rate-table-wrapper {
    overflow-x: auto;
}

.rate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.rate-table thead {
    background: linear-gradient(135deg, #004526 0%, #006837 100%);
    color: #ffffff;
}

.rate-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.rate-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.rate-table tbody tr:hover {
    background-color: rgba(249, 250, 251, 0.8);
}

.rate-table tbody tr:last-child {
    border-bottom: none;
}

.rate-table td {
    padding: 1rem;
    color: #1f2937;
}

.rate-table td strong {
    color: #004526;
    font-weight: 700;
}

.rate-table__highlight {
    background: #eef7f0;
}

.rate-table__highlight td {
    font-weight: 600;
}

/* ============================================
   Mobile layout safety (no horizontal overflow)
   ============================================ */

.paybill-calc-board,
.rate-table-container,
.article-content,
.limits-grid,
.limits-card,
.faq-list,
.faq-item {
    max-width: 100%;
    box-sizing: border-box;
}

.paybill-calc-board,
.rate-table-container,
.article-content,
.limits-card,
.faq-item {
    overflow-wrap: anywhere;
}

/* ============================================
   4. ARTICLE CONTENT SECTION - NOTEBOOK STYLE
   ============================================ */

.article-content-section {
    background: #f5f5f0;
    padding: 4rem 0;
}

.article-content {
    max-width: 900px;
    margin: 0 auto;
    background: #fffef8;
    position: relative;
    padding: 3rem 3rem 3rem 5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    background-image:
        linear-gradient(transparent, transparent 31px, #e0dfd8 31px, #e0dfd8 32px),
        linear-gradient(90deg, #d4534f 0, #d4534f 2px, transparent 2px);
    background-size: 100% 32px, 100% 100%;
    background-position: 0 40px, 0 0;
}

.article-content::before {
    content: '';
    position: absolute;
    left: 4rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #d4534f;
    opacity: 0.6;
}

.article-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: none;
    position: relative;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 1rem;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.article-body {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: #374151;
    margin: 0 0 1rem;
}

.article-body p {
    margin: 0 0 1.5rem;
}

.article-lead {
    font-size: 1.25rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.article-body h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 2.5rem 0 1.25rem;
    line-height: 1.3;
}

.article-body h4 {
    font-size: 1.35rem;
    font-weight: 600;
    color: #111827;
    margin: 2rem 0 1rem;
    line-height: 1.4;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.5rem;
    padding-left: 1.75rem;
}

.article-body li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.article-body li strong {
    color: #111827;
    font-weight: 600;
}

.article-body strong {
    color: #111827;
    font-weight: 600;
}

@media (max-width: 768px) {
    .article-content-section {
        padding: 2rem 1rem;
    }

    .article-content {
        padding: 2rem 1.5rem 2rem 3.5rem;
        background-size: 100% 28px, 100% 100%;
        background-position: 0 32px, 0 0;
    }

    .article-content::before {
        left: 3rem;
    }

    .article-title {
        font-size: 1.875rem;
    }

    .article-body {
        font-size: 1rem;
    }

    .article-lead {
        font-size: 1.125rem;
    }

    .article-body h3 {
        font-size: 1.5rem;
        margin: 2rem 0 1rem;
    }

    .article-body h4 {
        font-size: 1.25rem;
        margin: 1.5rem 0 0.75rem;
    }
}

/* ============================================
   5. LIMITS SECTION
   ============================================ */

.limits-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #004526 0%, #006837 100%);
    position: relative;
    overflow: hidden;
}

.limits-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.limits-heading h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.limits-heading p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
}

.limits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.limits-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.limits-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.limits-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.limits-value {
    font-size: 2rem;
    font-weight: 900;
    color: #004526;
    margin-bottom: 0.5rem;
}

.limits-description {
    font-size: 0.95rem;
    color: #6b7280;
}

/* ============================================
   6. FAQ SECTION
   ============================================ */

.faq-section {
    padding: 4rem 0;
    background: #ffffff;
}

.faq-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.faq-heading h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.faq-heading p {
    font-size: 1.125rem;
    color: #6b7280;
}

.faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: #004526;
}

.faq-item[open] {
    box-shadow: 0 12px 30px rgba(0, 69, 38, 0.15);
    border-color: #004526;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #f9fafb;
}

.faq-item[open] .faq-question {
    background: #f0fdf4;
}

.faq-question span {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    flex: 1;
    padding-right: 1rem;
}

.faq-question i {
    font-size: 1.5rem;
    font-weight: 700;
    color: #004526;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item[open] .faq-question i {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: #4b5563;
    line-height: 1.7;
    font-size: 1rem;
}

.faq-answer strong {
    color: #004526;
    font-weight: 700;
}

.faq-answer[hidden] {
    display: none;
}

/* ============================================
   7. RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .paybill-hero-section {
        padding: 3rem 0 8rem;
    }

    .paybill-hero-title {
        font-size: 1.875rem;
    }

    .paybill-calc-board {
        padding: 1.5rem 1rem;
    }

    .paybill-calc-input input {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }

    .paybill-calc-submit {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .rate-table-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .paybill-calc-board {
        margin: -1rem 1rem 0;
        transform: translateY(5rem);
        width: auto;
    }

    .rate-table-container {
        padding: 1.25rem;
    }

    .rate-table-wrapper {
        overflow-x: visible;
    }

    .rate-table {
        display: block;
    }

    .rate-table thead {
        display: none;
    }

    .rate-table tbody {
        display: block;
    }

    .rate-table tr {
        display: block;
        border: 1px solid #e5e7eb;
        border-radius: 0.75rem;
        padding: 0.5rem 0.75rem;
        margin-bottom: 1rem;
        background: #ffffff;
    }

    .rate-table td {
        display: block;
        padding: 0.6rem 0;
        border-bottom: 1px solid rgba(229, 231, 235, 0.7);
        text-align: left;
        word-break: normal;
        overflow-wrap: normal;
    }

    .rate-table td:last-child {
        border-bottom: none;
    }

    .rate-table td::before {
        color: #6b7280;
        font-weight: 600;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        display: block;
        margin-bottom: 0.35rem;
    }

    .rate-table td:nth-child(1)::before {
        content: "Bands (KES)";
    }

    .rate-table td:nth-child(2)::before {
        content: "Customer Pays (KES)";
    }

    .rate-table td:nth-child(3)::before {
        content: "Business Pays (KES)";
    }

    .rate-table td:nth-child(4)::before {
        content: "Total Fee (KES)";
    }
}
