/* Client billing portal. Shared pieces: css/app-ui.css + css/components.css. */

html {
    color-scheme: dark;
}

body {
    min-height: 100vh;
    background: radial-gradient(120% 80% at 50% 0%, #1b0533 0%, #07030d 60%, #000 100%);
    overflow-x: clip;
}

.portal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 640px;
    margin: 0 auto;
    padding: 1.5rem 1rem 0;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ui-text);
    text-decoration: none;
    font-family: var(--ui-font-display);
    font-weight: 800;
    font-size: 1.15rem;
    border-radius: var(--ui-radius-sm);
}

.portal-bar__links {
    display: flex;
    gap: 6px;
}

.portal {
    max-width: 640px;
    margin: 0 auto;
    padding: 3rem 1rem 5rem;
}

.portal-intro {
    margin-bottom: 2rem;
}

.portal-intro h1 {
    font-family: var(--ui-font-display);
    font-size: clamp(2rem, 6vw, 2.75rem);
    font-weight: 800;
    line-height: 1.1;
    text-wrap: balance;
}

.portal-intro p {
    margin-top: 0.5rem;
    color: var(--ui-text-muted);
}

.portal-card {
    background: rgba(16, 12, 24, 0.6);
    border: 1px solid var(--ui-border);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(24px);
}

.portal-card[hidden] {
    display: none;
}

.portal-loading {
    padding: 1.5rem;
}

.portal-message {
    text-align: center;
}

.portal-message h2 {
    font-family: var(--ui-font-display);
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.portal-message p {
    color: var(--ui-text-muted);
    line-height: 1.55;
    max-width: 46ch;
    margin: 0 auto;
}

.portal-message a {
    color: #e6a8ff;
}

.portal-message .btn {
    margin-top: 1.25rem;
}

.portal-message--error {
    border-color: rgba(255, 93, 115, 0.35);
}

.portal-message--error h2 {
    color: var(--danger-text, #ff9aa8);
}

.portal-message__icon {
    font-size: 2.25rem;
    color: var(--ui-text-muted);
    margin-bottom: 1rem;
}

.portal-figures {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--ui-border);
}

.portal-figure__label {
    font-size: 0.85rem;
    color: var(--ui-text-muted);
    margin-bottom: 0.3rem;
}

.portal-figure__value {
    font-family: var(--ui-font-display);
    font-size: clamp(2.25rem, 8vw, 3rem);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.portal-figure__value--sm {
    font-size: 1.5rem;
    color: #a9c1ff;
}

.portal-figure--secondary {
    text-align: right;
}

.portal-pay {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.portal-pay[hidden] {
    display: none;
}

.portal-pay input {
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
}

.btn.portal-pay__submit {
    min-height: 52px;
    font-size: 1rem;
}

.portal-note {
    font-size: 0.8rem;
    color: var(--ui-text-muted);
    text-align: center;
}

.portal-paid {
    text-align: center;
    padding: 1rem 0;
}

.portal-paid[hidden] {
    display: none;
}

.portal-paid__mark {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    border: 2px solid var(--ui-ok);
    background: rgba(60, 207, 145, 0.1);
    color: var(--ui-ok);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.portal-paid h2 {
    font-family: var(--ui-font-display);
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}

.portal-paid p {
    color: var(--ui-text-muted);
}

@media (max-width: 480px) {
    .portal-card {
        padding: 1.5rem;
        border-radius: 20px;
    }
    .portal-figure--secondary {
        text-align: left;
    }
}

/* The invoice pay page (pay.html) and the portal's invoice list: details, lines and the bank transfer note. */
.pay-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
}

.pay-meta dt {
    color: var(--ui-text-muted);
    font-size: 0.8rem;
}

.pay-meta dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.pay-lines {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-variant-numeric: tabular-nums;
}

.pay-lines th,
.pay-lines td {
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid var(--ui-border);
    text-align: left;
    overflow-wrap: anywhere;
}

.pay-lines thead th {
    color: var(--ui-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.pay-lines .num {
    text-align: right;
    white-space: nowrap;
}

.pay-lines tfoot th {
    font-weight: 400;
    color: var(--ui-text-muted);
}

.pay-lines .pay-total th,
.pay-lines .pay-total td {
    color: var(--ui-text);
    font-weight: 700;
}

.pay-transfer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ui-border);
}

.pay-transfer h2 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.pay-transfer p {
    color: var(--ui-text-muted);
    white-space: pre-line;
}

#pay-card,
.portal-invoice .btn + .btn {
    margin-top: 0.5rem;
}

.portal-invoice + .portal-invoice {
    margin-top: 1rem;
}

.portal-invoice h2 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.portal-invoice p {
    color: var(--ui-text-muted);
}
