/* ---- Lease card step ----
   #ModalLeaseCard (product page) and /Lease/Card share Views/Lease/_LeaseCardPanel.cshtml, so the
   panel is styled once, by class. Plain CSS like the other pages (Tailwind is only for the home
   revamp); the colours are the site's: #4285F4 blue, #191919 text, #6b7280 muted, #e8edf2 lines.
   Logical properties (inline-start/end) so the Arabic layout mirrors without extra rules. */

.lease-card {
    color: #191919;
    font-size: 0.95rem;
}

.lease-card p {
    margin: 0 0 12px;
}

.lease-card-muted {
    color: #6b7280;
    font-size: 0.875rem;
}

.lease-card-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 140px;
}

.lease-card-spinner {
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
    border: 3px solid #e8edf2;
    border-top-color: #4285F4;
    border-radius: 50%;
    animation: leaseCardSpin 0.8s linear infinite;
}

@keyframes leaseCardSpin {
    to { transform: rotate(360deg); }
}

.lease-card-label {
    font-weight: 600;
}

/* "Visa ending 4242, expires 12/30" */
.lease-card-masked {
    border: 1px solid #e8edf2;
    border-radius: 8px;
    background: #F7F7F7;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* The fee has to be read before Submit, so it is set apart rather than small print. */
.lease-card-disclosure {
    border-inline-start: 3px solid #4285F4;
    background: #f3f7fe;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.lease-card-note {
    border-inline-start: 3px solid #d97706;
    background: #fef3c7;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.875rem;
}

.lease-card-result-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.lease-card-banner {
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.lease-card-banner-success { background: #ecfdf3; border-color: #b7ebc6; color: #1e6b36; }
.lease-card-banner-info    { background: #f3f7fe; border-color: #c9dafb; color: #1f4e9e; }
.lease-card-banner-warning { background: #fef3c7; border-color: #f6d88a; color: #8a5300; }
.lease-card-banner-danger  { background: #fdecec; border-color: #f5c2c2; color: #a12626; }

.lease-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.lease-card-btn {
    flex: 1 1 160px;
    min-height: 46px;
    padding: 10px 16px;
    border: 1px solid #4285F4;
    border-radius: 6px;
    background: #4285F4;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .lease-card-btn:hover {
        color: #fff;
        background: #2f73e0;
    }

.lease-card-btn-secondary {
    background: #fff;
    color: #4285F4;
}

    .lease-card-btn-secondary:hover {
        background: #f3f7fe;
        color: #4285F4;
    }

.lease-card-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Declining is one quiet step away from the buttons, never next to Submit. */
.lease-card-cancel {
    display: block;
    margin: 18px auto 0;
    padding: 4px 8px;
    border: 0;
    background: none;
    color: #a12626;
    font-size: 0.875rem;
    text-decoration: underline;
    cursor: pointer;
}

    .lease-card-cancel:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

/* common.css makes every .modal-content transparent; each dialog brings its own panel. */
#ModalLeaseCard .modal-content {
    background: #fff;
    border-radius: 12px;
}

#ModalLeaseCard .modal-header {
    border-bottom: 1px solid #EEEEEE;
    padding: 16px 24px;
}

#ModalLeaseCard .modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #383838;
}

#ModalLeaseCard .modal-body {
    padding: 20px 24px 24px;
}

/* ---- /Lease/Card ---- */

/* custom.css pins .container to 1280px !important, so the width cap sits on the contents. */
.lease-page {
    margin-top: 50px;
    padding-bottom: 120px;
}

    .lease-page h1,
    .lease-page-box {
        max-width: 720px;
        margin-inline: auto;
    }

    .lease-page h1 {
        font-weight: 700;
        font-size: 1.5rem;
        color: #191919;
        margin-bottom: 20px;
    }

.lease-page-box {
    border: 1px solid #70707036;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    padding: 24px;
}

.lease-summary {
    display: flex;
    gap: 16px;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #EEEEEE;
}

.lease-summary-photo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #EEEEEE;
    border-radius: 6px;
    padding: 4px;
    flex: 0 0 auto;
}

.lease-summary-text {
    min-width: 0;
}

.lease-summary-name {
    font-weight: 600;
}

.lease-summary-plan {
    margin-top: 4px;
    font-size: 0.875rem;
}

@media (max-width: 575.98px) {
    .lease-page {
        margin-top: 24px;
    }

    .lease-page-box {
        padding: 16px;
    }

    .lease-card-btn {
        flex-basis: 100%;
    }
}

/* ---- /Lease/Confirm and /Lease/Confirmation ----
   Same box, banners, buttons and summary as /Lease/Card; below, only what the confirmation adds:
   the plan table, the consent, the busy button and the "confirmed" mark. */

.lease-plan-table-wrap {
    overflow-x: auto;
    margin-bottom: 12px;
    border: 1px solid #e8edf2;
    border-radius: 8px;
}

.lease-plan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

    .lease-plan-table th,
    .lease-plan-table td {
        padding: 8px 12px;
        border-bottom: 1px solid #EEEEEE;
        text-align: start;
        white-space: nowrap;
    }

    .lease-plan-table th {
        background: #F7F7F7;
        color: #6b7280;
        font-weight: 600;
    }

    .lease-plan-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .lease-plan-table .lease-plan-num {
        width: 3em;
        color: #6b7280;
    }

    .lease-plan-table .lease-plan-amount {
        text-align: end;
        font-variant-numeric: tabular-nums;
    }

    .lease-plan-table .lease-plan-total {
        font-weight: 600;
    }

    /* Month 1 is the one charged now. */
    .lease-plan-table tr.lease-plan-now td {
        background: #f3f7fe;
        font-weight: 600;
    }

.lease-confirm-per-charge {
    font-weight: 700;
    font-size: 1.05rem;
}

.lease-confirm-deadline {
    color: #8a5300;
    font-size: 0.875rem;
    font-weight: 600;
}

/* The database's consent text is the checkbox's label, so it reads as what is being agreed to. */
.lease-consent {
    border: 1px solid #e8edf2;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 16px 0;
}

.lease-card .lease-consent-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.lease-consent-label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #191919;
}

    .lease-consent-label input[type="checkbox"] {
        flex: 0 0 auto;
        width: 20px;
        height: 20px;
        margin: 1px 0 0;
        accent-color: #4285F4;
        cursor: pointer;
    }

    .lease-consent-label input[type="checkbox"]:disabled {
        cursor: not-allowed;
    }

.lease-consent-para {
    display: block;
}

    .lease-consent-para + .lease-consent-para {
        margin-top: 10px;
    }

/* Confirm & pay while the call is out: a small spinner before the label. */
.lease-card-btn.is-busy::before {
    content: "";
    width: 16px;
    height: 16px;
    margin-inline-end: 8px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: leaseCardSpin 0.8s linear infinite;
}

/* The "Lease confirmed" tick. */
.lease-confirm-done {
    position: relative;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: #ecfdf3;
    border: 2px solid #1e6b36;
}

    .lease-confirm-done::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 45%;
        width: 12px;
        height: 22px;
        border: solid #1e6b36;
        border-width: 0 3px 3px 0;
        transform: translate(-50%, -50%) rotate(45deg);
    }

@media (max-width: 575.98px) {
    .lease-plan-table th,
    .lease-plan-table td {
        padding: 6px 8px;
    }
}

/* ---- /Lease/FakeCardGateway (Testing only) ----
   A page of its own, no site layout: it stands in for the gateway's site. */

.lease-fake-gateway {
    margin: 0;
    min-height: 100vh;
    background: #1f2937;
    color: #111827;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px;
    box-sizing: border-box;
}

.lease-fake-box {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

    .lease-fake-box h1 {
        font-size: 1.25rem;
        margin: 0 0 8px;
    }

.lease-fake-badge {
    display: inline-block;
    margin: 0 0 12px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.lease-fake-notice {
    margin: 0 0 20px;
    padding: 10px 12px;
    border: 2px dashed #dc2626;
    border-radius: 6px;
    color: #991b1b;
    font-size: 0.9rem;
}

.lease-fake-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lease-fake-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

    .lease-fake-card:hover {
        border-color: #4285F4;
        background: #f3f7fe;
    }

.lease-fake-card-number {
    font-weight: 700;
    font-family: ui-monospace, Consolas, monospace;
}

.lease-fake-card-outcome {
    color: #4b5563;
    font-size: 0.875rem;
}
