:root {
    --red: #177A47;
    --red-dark: #155d38;
    --text: #30343b;
    --muted: #70757d;
    --border: #57e29a;
    --light-red: #fff5f6;
    --background: #ffffff;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: auto;
    scrollbar-width: none;
    /* Firefox */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Edge */
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.contribution-section {
    width: 100%;
    max-width: 526px;
    height: auto;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

.donation-card {
    width: 100%;
    max-width: 526px;
    background: var(--white);
    border-radius: 8px;
    padding: 24px;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: visible;
}

/* Completely hide scrollbar for Webkit (Chrome, Safari, Edge) to eliminate layout shift */
.donation-card::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Razorpay overlay breakout */
.razorpay-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
}

/* ─── Form Sizing & Layout (Brand Palette Preserved) ─── */
.form-step-1 {
    width: 100%;
    box-sizing: border-box;
}

.d-flex {
    display: flex;
}

.justify-content-evenly {
    justify-content: space-evenly;
    gap: 8px;
}

.align-items-center {
    align-items: center;
}

.w-100 {
    width: 100%;
}

.m-1 {
    margin: 4px;
}

.mt-1 {
    margin-top: 6px;
}

.mt-2 {
    margin-top: 10px;
}

.mt-3 {
    margin-top: 10px;
}

.pt-4 {
    padding-top: 1.5rem;
}

.me-4 {
    margin-right: 24px;
}

.fw-400 {
    font-weight: 400;
}

.fw-600 {
    font-weight: 600;
}

.fs-12 {
    font-size: 12px;
}

.fs-20 {
    font-size: 20px;
}

.fs-22 {
    font-size: 20px;
}

.lh-1-2em {
    line-height: 1.3em;
}

.lh-1-4em {
    line-height: 1.4em;
}

.text-secondary {
    color: #495057;
    margin: 0 0 12px 0;
    font-weight: 600;
}

/* ─── Button Checks (Radio as outline buttons) ─── */
.btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.frequency-toggle-group {
    display: flex;
    gap: 8px;
    width: fit-content;
    margin-bottom: 6px;
}

.frequency-toggle-group .toggle-btn-wrap {
    width: 99px;
    max-width: 99px;
    height: 38px;
    max-height: 38px;
    margin: 0;
}

.frequency-toggle-group .btn-outline-danger {
    width: 99px;
    max-width: 99px;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.btn-outline-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--red);
    background-color: transparent;
    border: 1.5px solid var(--red);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s ease-in-out;
    text-align: center;
    user-select: none;
    box-sizing: border-box;
    min-height: 42px;
}

.btn-outline-danger:hover {
    color: #fff;
    background-color: var(--red);
    border-color: var(--red);
}

.btn-check:checked+.btn-outline-danger {
    color: #fff;
    background-color: var(--red);
    border-color: var(--red);
    box-shadow: 0 2px 6px rgba(23, 122, 71, 0.25);
}

/* Amount Slabs Grid */
.slabs-container {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.slabs-container>div {
    margin: 0 !important;
    width: 100% !important;
}

.slabs-container .btn-outline-danger {
    width: 100%;
    height: 48px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 4px 6px;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .slabs-container {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 420px) {
    .slabs-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .slabs-container>div:last-child {
        grid-column: span 2;
    }
}

/* Amount meta box (Unified Impact Text & Other Amount Input Section) */
.amount-meta {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 8px 0 6px;
    text-align: center;
    font-size: 13px;
    color: #495057;
    font-weight: 500;
    line-height: 1.35;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.other-input-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.other-input-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1.5px solid #ced4da;
    border-radius: 6px;
    padding: 0 10px;
    width: 100%;
    max-width: 250px;
    height: 34px;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.other-input-row:focus-within {
    border-color: var(--red);
    box-shadow: 0 0 0 2px rgba(23, 122, 71, 0.15);
}

.other-currency-symbol {
    font-size: 16px;
    font-weight: 700;
    color: var(--red);
    margin-right: 6px;
    user-select: none;
}

.other-amount-input {
    border: none;
    outline: none;
    width: 100%;
    height: 100%;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    background: transparent;
    padding: 0;
    text-align: left;
}

.other-impact-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.25;
    margin: 0;
}

/* Citizen radios */
.citizen-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 16px 0 10px;
    flex-wrap: wrap;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    user-select: none;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--red);
}

.form-check-label {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

/* Foreign alert */
.alert-danger {
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    color: #9b2c2c;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 12px;
    text-align: left;
}

.alert-danger a {
    color: #c53030;
    font-weight: 600;
    text-decoration: underline;
}

.legal-note {
    color: var(--muted);
    margin: 0 0 12px;
}

/* Big Proceed / Donate Now Button */
.proceed-button {
    width: 100%;
    height: 52px;
    background-color: var(--red);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
}

.proceed-button:hover {
    background-color: var(--red-dark);
    transform: translateY(-1px);
}

.proceed-button:active {
    transform: translateY(0);
}

/* Payment badges */
.payment-badges {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 16px;
    margin-top: 5px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.payment-badges img {
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
}

@media (max-width: 520px) {
    .slabs-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .donation-card {
        padding: 18px 14px;
    }

    .proceed-button {
        height: 48px;
        font-size: 18px;
    }
}

.impact-box {
    margin-top: 14px;
    margin-bottom: 25px;
    padding: 18px;
    background: #f7f8f9;
    border: 1px solid #e5e6e8;
    border-radius: 8px;
    text-align: center;
}

.impact-box p {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: #555a61;
}

.options {
    display: grid;
    gap: 13px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
}

.choice,
.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #55595e;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.radio,
.check {
    width: 19px;
    height: 19px;
    min-width: 19px;
    border: 2px solid #dddfe3;
    display: inline-grid;
    place-items: center;
    position: relative;
    background: #fff;
    box-sizing: border-box;
}

.radio {
    border-radius: 50%;
}

.check {
    border-radius: 3px;
}

.real-radio,
.real-check {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.real-radio:checked+.radio {
    border-color: var(--red);
    background: var(--red);
    box-shadow: inset 0 0 0 4px #fff;
}

.real-check:checked+.check {
    background: var(--red);
    border-color: var(--red);
}

.real-check:checked+.check:after {
    content: "✓";
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    line-height: 1;
}

.legal {
    color: #70747a;
    font-size: 10.5px;
    line-height: 1.45;
    margin: 22px 0 16px;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

.details-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.details-title h2 {
    margin: 0;
    font-size: 22px;
    color: #25282d;
}

.back {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: 0;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 19px;
    line-height: 32px;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.back:hover {
    background: var(--red-dark);
}

.form {
    display: grid;
    gap: 10px;
}

.form input:not(.real-check):not(.real-radio),
.form textarea,
.form select {
    width: 100%;
    min-height: 46px;
    border: 1.5px solid #d9dadd;
    border-radius: 6px;
    background: #fff;
    color: #30343b;
    padding: 11px 13px;
    outline: 0;
    font: inherit;
    font-size: 14px;
    box-sizing: border-box;
    transition: 0.15s ease;
}

.form input[type="file"] {
    padding: 8px 10px;
    min-height: 42px;
}

.form textarea {
    min-height: 68px;
    resize: vertical;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
    border-color: var(--red);
}

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: #4e5257;
    margin-bottom: 2px;
    display: block;
}

.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ack {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.terms {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #55595e;
    font-size: 13px;
    cursor: pointer;
    line-height: 1.45;
    margin: 4px 0 6px;
    user-select: none;
}

.terms a {
    color: var(--red);
    text-decoration: none;
    font-weight: 600;
}

.terms a:hover {
    text-decoration: underline;
}

.error {
    background: #fff0ef;
    color: #b42318;
    border: 1px solid #f0c4bf;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 10px;
}

.hidden {
    display: none !important;
}

/* ─── Result Screens (Success & Failed) ─── */
.result-screen {
    text-align: center;
    padding: 10px 0 6px;
    animation: fadeIn 0.35s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-badge {
    width: 70px;
    height: 70px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-badge {
    background: #e7f7ed;
    color: #177A47;
    box-shadow: 0 0 0 8px rgba(23, 122, 71, 0.08);
}

.failed-badge {
    background: #fde8e8;
    color: #c53030;
    box-shadow: 0 0 0 8px rgba(197, 48, 48, 0.08);
}

.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.pill-success {
    background: #def7ec;
    color: #03543f;
}

.pill-failed {
    background: #fde8e8;
    color: #9b1c1c;
}

.result-title {
    margin: 0 0 8px;
    color: #1f2937;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.result-subtitle {
    color: var(--muted);
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.5;
}

.receipt-card {
    background: #fcfcfc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 18px;
    margin-bottom: 22px;
    text-align: left;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.receipt-amount-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}

.receipt-amount-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.receipt-amount-val {
    font-size: 26px;
    font-weight: 800;
    color: #177A47;
}

.receipt-divider {
    height: 1px;
    background: #eef0f2;
    margin-bottom: 14px;
}

.receipt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.receipt-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.receipt-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.receipt-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
}

.receipt-val.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: #4b5563;
}

.receipt-notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
}

.receipt-notice svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.success-notice {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.safe-notice {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.failure-card {
    background: #fff;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 22px;
    text-align: left;
}

.failure-reason-box {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 10px 12px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 14px;
}

.failure-reason-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #991b1b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.failure-reason-text {
    font-size: 13px;
    color: #b91c1c;
    line-height: 1.4;
    word-break: break-word;
}

.result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.failed-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
    text-decoration: none;
}

.action-btn.secondary {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.action-btn.secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.action-btn.whatsapp {
    background: #25D366;
    border: 1px solid #25D366;
    color: #fff;
}

.action-btn.whatsapp:hover {
    background: #20ba59;
    border-color: #20ba59;
}

.support-hint {
    font-size: 12px;
    color: var(--muted);
    margin: 12px 0 0;
}

.support-hint a {
    color: var(--red);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .result-actions {
        grid-template-columns: 1fr;
    }

    .receipt-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Printable Receipt */
@media print {
    body * {
        visibility: hidden;
    }

    .donation-card,
    #successStep,
    #successStep * {
        visibility: visible;
    }

    #successStep {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .result-actions,
    #anotherBtn {
        display: none !important;
    }
}

.secondary-button {
    width: 100%;
    height: 48px;
    border: 2px solid var(--red);
    border-radius: 7px;
    color: var(--red);
    background: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s ease;
}

.secondary-button:hover {
    background: var(--light-red);
}

.donate-button {
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 7px;
    background: var(--red);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
    margin-top: 5px;
}

.donate-button:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
}

.support-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.support-links a {
    color: var(--red);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.support-links a:hover {
    text-decoration: underline;
}

@media (max-width: 520px) {
    .contribution-section {
        padding: 0;
    }

    .donation-card {
        padding: 24px;
        border-radius: 0;
    }

    .two {
        grid-template-columns: 1fr;
    }
}