/* =========================================================
   SGI Calculator – FINAL, MATCHING REFERENCE
   ========================================================= */

.sgi-calculator {
    font-family: Orbitron, Arial, Helvetica, sans-serif !important;
}


/* Title */
.sgi-calculator > h2 {
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    color: #1f2a5a;
    margin-bottom: 18px;
}

/* Stack */
.sgi-calculator-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---------------------------------------------------------
   BASE FIELD
--------------------------------------------------------- */

.sgi-field {
    display: flex;
    flex-direction: column;
}

.sgi-field > label {
    font-size: 12px;
    color: #ff7a00 !important;
    margin-bottom: 4px;
}

.sgi-field > input,
.sgi-field > select {
    height: 32px;
    padding: 4px 6px;
    border: 1px solid #cfcfcf;
    font-size: 12px;
    background: #ffffff;
    box-sizing: border-box;
}

.sgi-field > input[type="number"] {
    text-align: right;
}

/* ---------------------------------------------------------
   RESULT ROWS (READONLY) – CORRECT STRUCTURE
--------------------------------------------------------- */

.sgi-field:has(input[readonly]) {
    display: grid;
    grid-template-columns: 1fr 180px;
    column-gap: 12px;
    align-items: center;
}

/* LEFT SIDE – BLUE BAR (LABEL) */
.sgi-field:has(input[readonly]) > label {
    background: #1f2a5a;
    color: #ffffff;
    padding: 8px 10px;
    margin: 0;
    font-size: 12px;
}

/* RIGHT SIDE – GREY VALUE (INPUT) */
.sgi-field:has(input[readonly]) > input {
    width: 180px;
    height: 32px;
    background: #f2f2f2;
    border: 1px solid #cfcfcf;
    color: #111;
    text-align: right;
    font-weight: normal;
}

/* ---------------------------------------------------------
   TOTAL EMPHASIS (TEXT ONLY, NOT COLOR)
--------------------------------------------------------- */

.sgi-field:has(input[name="total_annual_cost"]) > label,
.sgi-field:has(input[name="total_protection"]) > label {
    font-weight: bold;
}

.sgi-field:has(input[name="total_annual_cost"]) > input,
.sgi-field:has(input[name="total_protection"]) > input {
    font-weight: bold;
}

/* ---------------------------------------------------------
   VISUAL BREAK BEFORE RESULTS
--------------------------------------------------------- */

.sgi-field:nth-child(5) {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid #dddddd;
}

/* ---------------------------------------------------------
   MOBILE FALLBACK
--------------------------------------------------------- */

@media (max-width: 768px) {
    .sgi-field:has(input[readonly]) {
        grid-template-columns: 1fr;
    }

    .sgi-field:has(input[readonly]) > input {
        width: 100%;
    }
}
/* =========================================================
   SGI Calculator – Typography polish ONLY
   (No layout / color logic changes)
   ========================================================= */

/* Use a cleaner system font */
.sgi-calculator {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

/* Normal input labels (orange) */
.sgi-field > label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Result labels (white on blue) */
.sgi-field:has(input[readonly]) > label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Inputs & values */
.sgi-field > input,
.sgi-field > select {
    font-size: 12px;
    font-weight: 400;
}

/* Result values */
.sgi-field:has(input[readonly]) > input {
    font-size: 12px;
    font-weight: 500;
}

/* Totals – text emphasis only */
.sgi-field:has(input[name="total_annual_cost"]) > label,
.sgi-field:has(input[name="total_protection"]) > label {
    font-weight: 600;
}

.sgi-field:has(input[name="total_annual_cost"]) > input,
.sgi-field:has(input[name="total_protection"]) > input {
    font-weight: 600;
}
/* Result labels (readonly rows) */
.sgi-field:has(input[readonly]) > label {
    color: #ffffff !important;
}
/* =========================================================
   SGI Calculator – Input polish (minimal & safe)
   ========================================================= */

/* Text inputs & selects (normal fields only) */
.sgi-field > input:not([readonly]),
.sgi-field > select {
    height: 36px;                 /* slightly taller */
    padding: 6px 10px;
    border: 1px solid #c9c9c9;
    border-radius: 3px;           /* very subtle */
    font-size: 13px;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Focus state */
.sgi-field > input:not([readonly]):focus,
.sgi-field > select:focus {
    outline: none;
    border-color: #1f2a5a;        /* brand blue */
    box-shadow: 0 0 0 2px rgba(31, 42, 90, 0.08);
}

/* Placeholder (cleaner, softer) */
.sgi-field > input::placeholder {
    color: #b5b5b5;
}

/* Select arrow spacing */
.sgi-field > select {
    padding-right: 36px;
    cursor: pointer;
}

/* Slight spacing improvement between fields */
.sgi-calculator-form {
    gap: 18px;
}
/* =========================================================
   SGI Calculator – Stable Select Styling (FINAL)
   ========================================================= */

/* Stable native select */
/* Fully custom select */
.sgi-field > select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    height: 36px;
    padding: 6px 36px 6px 10px;
    font-size: 13px;
    font-family: Orbitron, Arial, sans-serif;

    border: 1px solid #c9c9c9;
    border-radius: 3px;
    background-color: #fff;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%231f2a5a'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.select2-selection__rendered {
    line-height: 41px !important;
}
.select2-container .select2-selection--single {
    height: 45px !important;
}
.select2-selection__arrow {
    height: 44px !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  height: 38px !important;
}

/* =========================================================
   SGI Calculator – FINAL FIX (ALIGNMENT PERFECT)
   ========================================================= */

/* Normal fields (full width input) */
.sgi-field .input-group {
    width: 100%;
    display: flex;
    margin-top: 4px;
}

/* Make input fill remaining space properly */
.sgi-currency-group .form-control {
    flex: 1;
    height: 36px;
    font-size: 13px;
    border-left: 0;
}

/* AUD box */
.sgi-currency-group .input-group-text {
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 12px;
    background: #f2f2f2;
    border: 1px solid #cfcfcf;
    white-space: nowrap;
}

/* Remove radius mismatch */
.sgi-currency-group .input-group-text,
.sgi-currency-group .form-control {
    border-radius: 0;
}

/* =========================================================
   🔥 READONLY ROWS (THE MAIN FIX)
   ========================================================= */

.sgi-field:has(.input-group input[readonly]) {
    display: grid;
    grid-template-columns: 1fr 180px;
    column-gap: 12px;
    align-items: center;
}

/* Force group inside right column */
.sgi-field:has(.input-group input[readonly]) .input-group {
    width: 180px;
}

/* KEY FIX: split width inside the 180px box */
.sgi-field:has(.input-group input[readonly]) .input-group-text {
    width: 60px;
    justify-content: center;
    padding: 0;
}

/* Remaining width goes to input */
.sgi-field:has(.input-group input[readonly]) .form-control {
    width: 120px;
    flex: none;
    background: #f2f2f2;
    border: 1px solid #cfcfcf;
}

/* =========================================================
   SMALL POLISH
   ========================================================= */

.sgi-currency-group {
    align-items: center;
}
/* =========================================================
   FIX: Bootstrap making inputs look like textarea
   ========================================================= */

.sgi-currency-group .form-control {
    height: 32px !important;
    padding: 4px 6px !important;
    font-size: 12px !important;
    line-height: normal !important;
}

/* Ensure it looks like your original inputs */
.sgi-field .form-control {
    background: #ffffff;
}

/* Keep readonly styling consistent */
.sgi-field:has(.input-group input[readonly]) .form-control {
    background: #f2f2f2 !important;
}
/* =========================================================
   FINAL WORKING FIX – MERGE AUD + INPUT PERFECTLY
   ========================================================= */

/* Make input-group behave like original input */
.sgi-field .input-group {
    display: flex;
    width: 100%;
}

/* Force both prefix + input same height */
.sgi-currency-group .input-group-text,
.sgi-currency-group .form-control {
    height: 32px !important;
}

/* Merge borders visually */
.sgi-currency-group .input-group-text {
    border: 1px solid #cfcfcf;
    border-right: none;
    border-radius: 3px 0 0 3px;
    background: inherit;
    padding: 4px 8px;
    font-size: 12px;
}

.sgi-currency-group .form-control {
    border: 1px solid #cfcfcf;
    border-left: none !important;
    border-radius: 0 3px 3px 0;
    padding: 4px 6px;
    font-size: 12px;
}

/* Editable fields background */
.sgi-field:not(:has(input[readonly])) 
.sgi-currency-group .input-group-text {
    background: #ffffff;
}

/* Readonly fields background */
.sgi-field:has(input[readonly]) 
.sgi-currency-group .input-group-text,
.sgi-field:has(input[readonly]) 
.sgi-currency-group .form-control {
    background: #f2f2f2;
}

/* IMPORTANT: Fix grid alignment for readonly rows */
.sgi-field:has(.input-group input[readonly]) {
    display: grid;
    grid-template-columns: 1fr 180px;
    column-gap: 12px;
    align-items: center;
}

/* Make wrapper act like original input */
.sgi-field:has(.input-group input[readonly]) 
.input-group {
    width: 180px;
}

/* Let input expand naturally */
.sgi-field:has(.input-group input[readonly]) 
.form-control {
    flex: 1;
}
/* =========================================================
   FINAL SIZE MATCH FIX (MINIMAL PATCH)
   ========================================================= */

/* Remove forced split widths */
.sgi-field:has(.input-group input[readonly]) .input-group-text {
    width: auto !important;
}

.sgi-field:has(.input-group input[readonly]) .form-control {
    width: auto !important;
}

/* Ensure both elements same height */
.sgi-currency-group .input-group-text,
.sgi-currency-group .form-control {
    height: 32px !important;
    box-sizing: border-box;
}

/* Ensure wrapper equals original input width */
.sgi-field:has(.input-group input[readonly]) .input-group {
    width: 180px;
}
.sgi-currency-group input {
    border-radius: 0 !important;
}
/* =========================================================
   Currency prefix styling improvement
   ========================================================= */

/* Make AUD$ slightly bolder */
.sgi-currency-group .input-group-text {
    font-weight: 600;
    color: #444;
}

/* Add visual separator like banking UI */
.sgi-currency-group .input-group-text {
    border-right: 1px solid #cfcfcf !important;
}

/* Ensure input does not double-border */
.sgi-currency-group .form-control {
    border-left: none !important;
}

/* Optional: tighten spacing for cleaner look */
.sgi-currency-group .input-group-text {
    padding-left: 10px;
    padding-right: 10px;
}
/* =========================================================
   FINAL FIX: readonly currency width mismatch
   ========================================================= */

/* Make currency wrapper behave exactly like original readonly input */
.sgi-field:has(.input-group input[readonly]) .input-group {
    width: 180px !important;
    display: grid;
    grid-template-columns: auto 1fr;
}

/* Keep prefix natural width */
.sgi-field:has(.input-group input[readonly]) .input-group-text {
    width: auto !important;
    min-width: 58px;
}

/* Let number fill remaining space exactly */
.sgi-field:has(.input-group input[readonly]) .form-control {
    width: 100% !important;
}

