/* Billing (?id=177), the payment-required page and the payment step of the signup page (V0011).
   The payment method widget (.billing-vault) is shared by the three. */

/* ── the Billing page ── */
.billing-page .billing-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
    padding: 14px 18px;
    border: 1px solid #f2c4bf;
    border-radius: 12px;
    background: #fdeceb;
    color: #8a2b20;
}

.billing-page .billing-alert.is-warning {
    border-color: #f0d7a7;
    background: #fdf6e7;
    color: #8a5a12;
}

.billing-page .billing-alert i {
    font-size: 20px;
}

.billing-page .billing-alert .billing-alert-text {
    flex: 1;
}

.billing-page .billing-alert b {
    display: block;
    margin-bottom: 2px;
}

.billing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.billing-grid .detail-card {
    margin: 0;
}

/* the full-width cards under the grid (Billing contact, Invoices) keep the grid's spacing between them */
.billing-manage > .detail-card + .detail-card {
    margin-top: 16px;
}

.billing-method-current {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 16px;
    padding: 12px 14px;
    border: 1px solid #e2eaf2;
    border-radius: 10px;
    background: #f7fafd;
}

.billing-method-current i {
    font-size: 22px;
    color: #3489ca;
}

.billing-method-current b {
    display: block;
    color: #0d1f35;
}

.billing-method-current span {
    color: #7b8a9e;
    font-size: 12.5px;
}

/* the PayPal form opens under the method on file only after Add Payment Method; Cancel closes it */
.billing-add-method-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.billing-add-method-form[hidden],
#billing-add-method[hidden] {
    display: none;
}

#billing-add-method-cancel {
    align-self: flex-start;
}

.billing-estimate {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.billing-estimate th {
    padding: 8px 10px;
    border-bottom: 1px solid #e2eaf2;
    color: #3d5a75;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .4px;
    text-align: left;
    text-transform: uppercase;
}

.billing-estimate td {
    padding: 9px 10px;
    border-bottom: 1px solid #eef3f9;
}

.billing-estimate .num {
    text-align: right;
}

.billing-estimate tfoot td {
    border-bottom: 0;
    font-weight: 700;
    color: #0d1f35;
}

/* the add-on lines are indented under the plan line, the same 48px as the admin portal's Billing tab */
.billing-estimate .billing-addon-line td:first-child {
    padding-left: 48px;
}

/* a trial plan charges nothing: its list price per user shows crossed out next to the $0 (per-user pricing, V0014) */
.list-price-crossed {
    margin-right: 4px;
    color: #8a99ad;
    font-weight: 400;
    text-decoration: line-through;
}

.billing-contact-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.billing-contact-form .form-group {
    margin-bottom: 0;
}

.billing-contact-form .form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
}

/* a billing document's pages (drawn on the server, the same images the email shows); also used by the admin portal */
.billing-document-pages {
    max-height: 70vh;
    overflow-y: auto;
    padding: 12px;
    border-radius: 10px;
    background: #eef3f8;
}

.billing-document-pages img {
    display: block;
    width: 100%;
    max-width: 816px;
    height: auto;
    margin: 0 auto 12px;
    border: 1px solid #dbe4ee;
    background: #fff;
    box-shadow: 0 4px 14px rgba(13, 31, 53, .08);
}

.billing-document-pages img:last-child {
    margin-bottom: 0;
}

.billing-document-empty {
    margin: 0;
    padding: 24px;
    color: #7b8a9e;
    text-align: center;
}

@media (max-width: 1100px) {
    .billing-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .billing-estimate .billing-addon-line td:first-child {
        padding-left: 22px;
    }

    .billing-contact-form {
        grid-template-columns: 1fr;
    }
}

/* ── the payment method widget ── */
.billing-vault {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.billing-vault-paypal {
    min-height: 42px;
}

.billing-vault-or {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7b8a9e;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.billing-vault-or::before,
.billing-vault-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2eaf2;
}

.billing-vault-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.billing-vault-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.billing-vault-field {
    min-height: 54px;
}

.billing-vault-save {
    align-self: flex-end;
    margin-top: 6px;
}

.billing-vault-loading {
    padding: 14px 0;
    color: #7b8a9e;
}

/* ── the payment-required page ── */
.billing-locked {
    display: flex;
    justify-content: center;
    padding: 48px 16px;
}

.billing-locked-card {
    max-width: 560px;
    padding: 36px 40px;
    border: 1px solid #e2eaf2;
    border-radius: 18px;
    background: #fff;
    text-align: center;
    box-shadow: 0 12px 32px rgba(13, 31, 53, .08);
}

.billing-locked-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: #fdeceb;
    color: #c0392b;
    font-size: 28px;
}

.billing-locked-card h1 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
    color: #0d1f35;
}

.billing-locked-card p {
    margin: 0 0 22px;
    color: #3d5a75;
    font-size: 14.5px;
    line-height: 1.55;
}

.billing-locked-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── the signup page's payment step ── */
.signup-payment-step {
    display: none;
}

.signup-payment-step.is-open {
    display: block;
}

.signup-payment-step .signup-payment-summary {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #b5dfc5;
    border-radius: 10px;
    background: #e8f6ee;
    color: #1e6b3d;
    font-size: 13.5px;
}

.signup-payment-step .signup-payment-saved {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #eef4fa;
    color: #0d1f35;
    font-size: 13.5px;
}

.signup-promo-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.signup-promo-row .kivu-login-input-wrap {
    flex: 1;
}

/* the trial line under the promotion code: its own row of the signup grid, pulled up under the field */
.signup-promo-status {
    grid-column: 1 / -1;
    margin: -14px 0 0;
    font-size: 12.5px;
    color: #1e8e4a;
}

/* the signup page has no portal button styles: the save button matches its Confirm Registration button */
.signup-payment-step .billing-vault-save {
    height: 44px;
    padding: 0 22px;
    border: 0;
    border-radius: 10px;
    background: #3489ca;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.signup-payment-step .billing-vault-save:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* the Plan tile carries the way to the Upgrade Plan page (?id=183): words in its top right corner, no button face */
.billing-page .billing-plan-tile {
    position: relative;
}

.billing-page .billing-upgrade-link {
    position: absolute;
    right: 14px;
    top: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #3489ca;
    text-decoration: none;
}

.billing-page .billing-upgrade-link i {
    font-size: 10px;
    margin-left: 2px;
}

.billing-page .billing-upgrade-link:hover,
.billing-page .billing-upgrade-link:focus {
    color: #1f6fad;
    text-decoration: underline;
}
