/* Billing Adjustments - Customer-facing page styles
   Mirrors the visual language of changebillingcycle.css:
   service info card, clickable card grid (no radio lists), and
   blocked-row affordance for services that can't be adjusted. */


/* ========================================
   BLOCKED-ROW HIGHLIGHT
   For services that can't be adjusted (overdue, too-close, pending
   cancellation request). Light yellow background tells the customer
   "this row is different" before they read the action column.
   ======================================== */

.ba-services-table tr.ba-row--blocked {
    background: #fffbeb;
}

.ba-services-table tr.ba-row--blocked:hover {
    background: #fef3c7;
}

.ba-services-table .ba-row__block-reason {
    display: block;
    font-size: 12px;
    color: #92400e;
    margin-top: 4px;
    font-style: italic;
}


/* ========================================
   ADJUSTMENT OPTION CARDS
   Replace the radio-list pattern with clickable cards a la
   .billing-cycle-card from changebillingcycle.css. Each card is the
   click target; the embedded radio is hidden and synced via JS or
   submitted via form fallback (a hidden field set on click).
   ======================================== */

.ba-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.ba-option-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.ba-option-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #67a552;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ba-option-card:hover {
    border-color: #67a552;
    box-shadow: 0 8px 24px rgba(103, 165, 82, 0.15);
    transform: translateY(-2px);
}

.ba-option-card:hover:before {
    opacity: 1;
}

.ba-option-card--selected {
    border-color: #67a552;
    background: rgba(103, 165, 82, 0.04);
    box-shadow: 0 8px 24px rgba(103, 165, 82, 0.2);
}

.ba-option-card--selected:before {
    opacity: 1;
    width: 6px;
}

.ba-option-card--selected:after {
    content: '\f058'; /* fa-check-circle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 20px;
    color: #67a552;
}

.ba-option-card--current {
    border-color: #d1d5db;
    cursor: not-allowed;
    opacity: 0.65;
    background: #f9fafb;
}

.ba-option-card--current:hover {
    border-color: #d1d5db;
    box-shadow: none;
    transform: none;
}

.ba-option-card--current:hover:before {
    opacity: 0;
}

.ba-option-card__primary {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.2;
}

.ba-option-card__secondary {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.ba-option-card__price {
    font-size: 22px;
    font-weight: 700;
    color: #67a552;
    margin-top: 6px;
}

.ba-option-card__current-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.ba-option-card input[type="radio"],
.ba-option-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}


/* ========================================
   SYNC SERVICE PICKER (multi-select cards)
   ======================================== */

.ba-sync-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.ba-sync-service-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.ba-sync-service-card:hover:not(.ba-sync-service-card--blocked) {
    border-color: #67a552;
    box-shadow: 0 6px 18px rgba(103, 165, 82, 0.12);
}

.ba-sync-service-card--selected {
    border-color: #67a552;
    background: rgba(103, 165, 82, 0.04);
    box-shadow: 0 6px 18px rgba(103, 165, 82, 0.15);
}

.ba-sync-service-card--selected:after {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 18px;
    color: #67a552;
}

.ba-sync-service-card--blocked {
    background: #fffbeb;
    border-color: #fde68a;
    cursor: not-allowed;
    opacity: 0.85;
}

.ba-sync-service-card__hostname {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.ba-sync-service-card__product {
    font-size: 13px;
    color: #6b7280;
}

.ba-sync-service-card__meta {
    margin-top: 6px;
    font-size: 13px;
    color: #4b5563;
}

.ba-sync-service-card__blocked-note {
    font-size: 12px;
    font-style: italic;
    color: #92400e;
    margin-top: 4px;
}


/* ========================================
   FORM-WIDE LAYOUT BLOCKS
   ======================================== */

.ba-form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ba-anchor-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.ba-anchor-row label {
    font-weight: 600;
    color: #1f2937;
}

.ba-anchor-row input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    min-width: 180px;
}

.ba-help-text {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
    width: 100%;
}


/* ========================================
   BACK LINK
   ======================================== */

.ba-back-link {
    margin-bottom: 16px;
}


/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 767px) {
    .ba-options-grid {
        grid-template-columns: 1fr;
    }
    .ba-sync-services-grid {
        grid-template-columns: 1fr;
    }
}
