/**
 * Fakturačné údaje — billing profile form.
 *
 * Fields reuse the theme's .form-group styling; this file only adds the
 * layout, the person/organisation switch and the save feedback. Same CSS
 * variables as pricing.css, with fallbacks so the form survives on a page
 * the theme has not styled.
 */

.bezrisku-billing {
    max-width: 600px;
}

.bezrisku-billing__intro {
    margin: 0 0 var(--space-lg, 1.5rem);
    color: var(--text-secondary, #5A6B7D);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ─── Person / organisation switch ─────────────────────────────────── */

.bezrisku-billing__toggle {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm, 0.75rem);
    margin-bottom: var(--space-lg, 1.5rem);
}

.bezrisku-billing__toggle label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border: 2px solid var(--grey-300, #d6dbe1);
    border-radius: var(--radius-xl, 30px);
    background: var(--white, #fff);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy, #1B3A5C);
    cursor: pointer;
    transition: border-color var(--transition-fast, 0.2s), background-color var(--transition-fast, 0.2s);
}

.bezrisku-billing__toggle label:hover {
    border-color: var(--orange, #E8752A);
}

/* :has keeps the checked state on the label without a JS class toggle;
   browsers without it simply show the radio button instead. */
.bezrisku-billing__toggle label:has(input:checked) {
    border-color: var(--orange, #E8752A);
    background: var(--orange-bg, #FDF1E8);
}

.bezrisku-billing__toggle input {
    accent-color: var(--orange, #E8752A);
}

/* ─── Field rows ───────────────────────────────────────────────────── */

.bezrisku-billing__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0 var(--space-md, 1rem);
}

.bezrisku-billing__hint {
    margin: calc(-1 * var(--space-sm, 0.75rem)) 0 var(--space-lg, 1.5rem);
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary, #5A6B7D);
}

.bezrisku-billing input.has-error,
.bezrisku-billing select.has-error {
    border-color: #C0392B;
}

/* ─── Save feedback ────────────────────────────────────────────────── */

.bezrisku-billing__message {
    display: none;
    margin-bottom: var(--space-md, 1rem);
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md, 12px);
    font-size: 0.95rem;
    line-height: 1.5;
}

.bezrisku-billing__message.is-visible {
    display: block;
}

.bezrisku-billing__message.is-success {
    background: #E8F5EC;
    color: #1E6B3A;
}

.bezrisku-billing__message.is-error {
    background: #FCEBEA;
    color: #A5291C;
}

/* ─── Modal (opened when a purchase is missing billing details) ────── */

.bezrisku-billing-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-lg, 1.5rem);
    overflow-y: auto;
}

.bezrisku-billing-modal[hidden] {
    display: none;
}

.bezrisku-billing-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(27, 58, 92, 0.55);
}

.bezrisku-billing-modal__panel {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: auto;
    padding: var(--space-xl, 2rem);
    background: var(--white, #fff);
    border-radius: var(--radius-lg, 20px);
    box-shadow: var(--shadow-lg, 0 20px 60px rgba(27, 58, 92, 0.25));
}

.bezrisku-billing-modal__panel .bezrisku-billing {
    max-width: none;
}

.bezrisku-billing-modal__panel h2 {
    margin-top: 0;
}

.bezrisku-billing-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.9rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-secondary, #5A6B7D);
    background: none;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.bezrisku-billing-modal__close:hover {
    color: var(--navy, #1B3A5C);
    background: var(--cream, #FFF8F0);
}

@media (max-width: 600px) {
    .bezrisku-billing-modal {
        padding: 0;
    }

    .bezrisku-billing-modal__panel {
        border-radius: 0;
        min-height: 100%;
        padding: var(--space-lg, 1.5rem);
    }
}

/* ─── Invoice column in the customer's order history ───────────────── */

.bezrisku-invoice-link {
    font-weight: 600;
    color: var(--orange, #E8752A);
    white-space: nowrap;
}

.bezrisku-invoice-pending {
    color: var(--text-secondary, #5A6B7D);
    font-size: 0.9em;
    white-space: nowrap;
}
