/* Bill Payment Form Styles */
/* Colors: #F1FF5C (yellow accent), #22272D (dark), #AAB0B8 (muted), #F4FAFF (light bg) */

*, ::before, ::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Sora', sans-serif;
    /* background-color: #22272D; */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ── Card ── */
.card {
    background: #AAB0B8;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    padding: 2rem;
    width: 100%;
    max-width: 620px;
}

/* ── Card Header ── */
.card-header {
    margin-bottom: 1rem;
    border-bottom: 2px solid #F1FF5C;
    padding-left: 1rem;
}

.card-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #22272D;
    text-align: center;
}

.card-header p {
    margin-top: 0.3rem;
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: 1rem;
    /* color: #AAB0B8; */
}

/* ── Section Label ── */
.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    /* color: #AAB0B8; */
    margin-bottom: 0.5rem;
}

/* ── Divider ── */
.divider {
    border: none;
    border-top: 2px solid #F1FF5C;
    /* opacity: 0.3; */
    margin: 1.5rem 0;
}

/* ── Form Groups ── */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #22272D;
    margin-bottom: 0.4rem;
}

input,
select {
    width: 100%;
    padding: 0.65rem 0.875rem;
    border: 1.5px solid #AAB0B8;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: #22272D;
    background-color: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

input::placeholder {
    color: #AAB0B8;
}

input:focus,
select:focus {
    border-color: #F1FF5C;
    box-shadow: 0 0 0 3px rgba(241, 255, 92, 0.25);
}

/* Select arrow */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    pointer-events: none;
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #AAB0B8;
}

/* ── Mobile-Responsive Service Dropdown ── */
.select-mobile select {
    /* Prevent iOS auto-zoom (triggered when font-size < 16px) */
    font-size: 1rem;
    /* Larger tap target on touch screens */
    padding: 0.85rem 2.5rem 0.85rem 0.875rem;
    /* Ensure full-width on small screens */
    width: 100%;
    /* Remove default iOS styling */
    -webkit-appearance: none;
    appearance: none;
    /* Prevent text truncation on small screens */
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Reposition the custom arrow for the taller tap target */
.select-mobile::after {
    right: 1rem;
    width: 10px;
    height: 10px;
    border-left: 2px solid #22272D;
    border-bottom: 2px solid #22272D;
    border-top: none;
    border-right: none;
    transform: translateY(-65%) rotate(-45deg);
    /* Use a proper chevron instead of a triangle */
    width: auto;
    height: auto;
}

@media (max-width: 480px) {
    /* On small screens, top-align so card isn't clipped if it's tall */
    body {
        align-items: flex-start;
        padding: 1rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 0.75rem;
    }

    .select-mobile select {
        /* Even more generous tap target on very small screens */
        padding: 0.95rem 2.5rem 0.95rem 0.875rem;
    }
}

/* ── Submit Button ── */
.btn {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background-color: #F1FF5C;
    color: #22272D;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
    margin-top: 1.75rem;
    letter-spacing: 0.02em;
}

.btn:hover {
    background-color: #e8f54a;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* ── Response Brand Logo ── */
.response-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.response-logo {
    height: 2.5rem;
    width: auto;
}

/* ── Payment Response ── */
.response-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.875rem 1rem;
    border-radius: 0.6rem;
    font-size: 1rem;
    font-weight: 700;
    margin: 1rem 0;
}

.response-status svg {
    width: 1.4rem;
    height: 1.4rem;
    flex-shrink: 0;
}

.response-status--success {
    background-color: #d1fadf;
    color: #166534;
}

.response-status--failed {
    background-color: #fee2e2;
    color: #991b1b;
}

.receipt-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 0.6rem;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 0.875rem;
    border-bottom: 1px solid #e5e7eb;
}

.receipt-row:last-child {
    border-bottom: none;
}

.receipt-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.receipt-value {
    font-size: 0.875rem;
    color: #22272D;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.response-notice {
    font-size: 0.825rem;
    color: #22272D;
    background: #f9fafb;
    border-left: 3px solid #F1FF5C;
    padding: 0.7rem 0.875rem;
    border-radius: 0 0.4rem 0.4rem 0;
    margin-top: 0.25rem;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .receipt-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .receipt-value {
        text-align: left;
    }
}

/* ── Select2 overrides — match native inputs ── */
/*
 * NOTE: select2.min.css loads AFTER this file, so all Select2 overrides
 * need !important to win the specificity battle.
 */

/* Fix: Select2 appends its dropdown container to <body>.
 * Since body is display:flex, that container becomes a flex item and
 * collapses the page layout. Using position:fixed takes it out of the
 * flex flow AND out of the scroll area, so no scrollbars appear when
 * the dropdown opens. Select2's JS positions via getBoundingClientRect()
 * so fixed coordinates work correctly here.
 */
body > .select2-container {
    position: fixed !important;
    z-index: 9999 !important;
}

/* Prevent horizontal overflow/scrollbar from any stray positioned elements */
html {
    overflow-x: hidden;
}

.select2-container {
    width: 100% !important;
}

/* Selection box — same look as <input> */
.select2-container--default .select2-selection--single {
    height: auto !important;
    padding: 0.65rem 2.5rem 0.65rem 0.875rem !important;
    border: 1.5px solid #AAB0B8 !important;
    border-radius: 0.5rem !important;
    background-color: #fff !important;
    font-family: 'Sora', sans-serif !important;
    font-size: 0.9rem !important;
    color: #22272D !important;
    outline: none !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #F1FF5C !important;
    box-shadow: 0 0 0 3px rgba(241, 255, 92, 0.25) !important;
}

/* Displayed text — vertically centred, no extra padding (handled by parent) */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0 !important;
    line-height: 1.4 !important;
    color: #22272D !important;
    font-size: 0.9rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #AAB0B8 !important;
}

/* Arrow — fixed size so the inner <b> triangle centres correctly */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    position: absolute !important;
    top: 50% !important;
    right: 0.875rem !important;
    transform: translateY(-50%) !important;
    height: 16px !important;
    width: 16px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -25%) !important;
    border-color: #AAB0B8 transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
    margin: 0 !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #AAB0B8 transparent !important;
    border-width: 0 4px 5px 4px !important;
    transform: translate(-50%, -75%) !important;
}

/* Dropdown panel */
.select2-dropdown {
    border: 1.5px solid #F1FF5C !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    font-family: 'Sora', sans-serif !important;
    overflow: hidden !important;
    z-index: 9999 !important;
}

/* Search field inside dropdown */
.select2-container--default .select2-search--dropdown .select2-search__field {
    padding: 0.55rem 0.75rem !important;
    border: 1.5px solid #AAB0B8 !important;
    border-radius: 0.4rem !important;
    font-family: 'Sora', sans-serif !important;
    font-size: 0.875rem !important;
    color: #22272D !important;
    outline: none !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #F1FF5C !important;
    box-shadow: 0 0 0 3px rgba(241, 255, 92, 0.25) !important;
}

/* Options */
.select2-container--default .select2-results__option {
    padding: 0.6rem 0.875rem !important;
    font-size: 0.875rem !important;
    color: #22272D !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #F1FF5C !important;
    color: #22272D !important;
}

.select2-container--default .select2-results__option--selected {
    background-color: #f4faff !important;
    font-weight: 600 !important;
}

/* ── Select2 responsive tweaks ── */
@media (max-width: 480px) {
    /* Limit dropdown height on small screens so it doesn't run off-screen */
    .select2-results__options {
        max-height: 180px !important;
    }

    /* Slightly larger tap target for options on mobile */
    .select2-container--default .select2-results__option {
        padding: 0.75rem 0.875rem !important;
    }
}

/* ── Errors ── */
.error-box {
    background: #fff0f0;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.error-box ul {
    list-style: none;
    color: #dc2626;
    font-size: 0.875rem;
}

.error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}
