/* Hunity Signature UI - Harmonized with hunity-checkout design system */

body {
    font-family: "Inter", "Outfit", sans-serif;
    color: #1e293b;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.hunity-main {
    flex: 1 0 auto;
}

h1, h2, h3, h4, h5, h6,
.card-header {
    font-family: "Outfit", "Inter", sans-serif;
}

.card-header {
    background-color: #0255a3;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0.85rem 1.25rem;
    border-bottom: none;
}

/* Sticky summary on desktop without overlapping footer */
@media (min-width: 992px) {
    .div-summary {
        position: sticky;
        top: 24px;
        z-index: 10;
    }
}

@media (max-width: 991.98px) {
    .div-summary {
        position: static;
    }
}

/* Header agent avatar & language selector */
.agent-avatar-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #e8f0fe;
    color: #0255a3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.lang-switcher-btn {
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 6px !important;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.lang-switcher-btn:hover {
    background-color: #f0f4f9;
    border-color: #cbd5e1;
}

.lang-switcher-btn.active-lang {
    background-color: #e8f0fe;
    border-color: #0255a3;
}

.lang-switcher-btn .flag-icon {
    margin-right: 0;
}

/* Read-only data display fields matching checkout form-control-lg */
.field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.readonly-field {
    background-color: #f8fafc;
    border: 1px solid #d0d7de;
    border-radius: 0.375rem;
    padding: 0.55rem 0.85rem;
    min-height: 42px;
    font-size: 0.92rem;
    color: #1e293b;
    font-weight: 500;
    display: flex;
    align-items: center;
    word-break: break-word;
}

.readonly-textarea {
    background-color: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 0.375rem;
    padding: 0.55rem 0.85rem;
    min-height: 42px;
    width: 100%;
    font-size: 0.9rem;
    color: #334155;
    resize: none;
}

/* Tables inside cards */
.hunity-table thead th {
    background-color: #f1f5f9;
    color: #1e3664;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #cbd5e1;
    white-space: nowrap;
}

.hunity-table tbody td,
.hunity-table tbody th {
    font-size: 0.88rem;
    color: #334155;
    vertical-align: middle;
}

/* Ensure disabled+checked radios stay visibly highlighted in Hunity navy */
[type=radio]:disabled:checked {
    background-color: #1e3664 !important;
    opacity: 0.92;
}

[type=radio]:disabled:checked::before {
    box-shadow: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath d='M15.88 8.29L10 14.17l-1.88-1.88a.996.996 0 1 0-1.41 1.41l2.59 2.59c.39.39 1.02.39 1.41 0L17.3 9.7a.996.996 0 0 0 0-1.41c-.39-.39-1.03-.39-1.42 0z' fill='%23fff'/%3E %3C/svg%3E");
}

/* Medical questions layout */
.medical-question-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background-color: #f9f9fb;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1rem;
}

.medical-question-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.5;
    text-align: justify;
    margin-bottom: 0.75rem;
    display: block;
}

.m-radio-inline {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
}

.m-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-weight: 600;
    color: #334155;
    cursor: default;
}

/* Select2 integration with MDB/Bootstrap 5 */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #d0d7de !important;
    border-radius: 0.375rem !important;
    min-height: 42px !important;
    background-color: #ffffff !important;
    padding: 0.2rem 0.4rem !important;
}

.select2-container--default.select2-container--disabled .select2-selection--multiple {
    background-color: #f1f5f9 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #e8f0fe !important;
    border: 1px solid #0255a3 !important;
    color: #0255a3 !important;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
}

/* Declaration & Authorization boxes */
.declaration-box {
    background-color: #f9f9fb;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.declaration-box p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #334155;
    text-align: justify;
    margin-bottom: 0.85rem;
}

.declaration-box p:last-of-type {
    margin-bottom: 0;
}

/* Signature pad card */
.signature-pad-box {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    border-radius: 10px;
    padding: 1rem;
}

.signature-pad-canvas-wrap {
    position: relative;
    width: 100%;
    height: 300px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background-color: #ffffff;
    overflow: hidden;
}

.signature-pad-canvas-wrap canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}

/* Preloader matching Hunity styling */
#preloader {
    position: fixed;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.96);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#preloader [data-loader="circle-side-2"] {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #0255a3;
    border-radius: 50%;
    animation: hunity-spin 0.85s linear infinite;
}

@keyframes hunity-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Shake & disabled states used by control.js */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.shake-animation {
    animation: shake 0.4s ease-in-out;
}

.btn-disabled-visual {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Footer links hover */
footer a:hover {
    color: #ffffff !important;
}

/* Summary accordion & badges */
.summary-category-header .summary-chevron {
    transition: transform 0.2s ease;
}

.summary-category-header.collapsed .summary-chevron {
    transform: rotate(180deg);
}

.summary-category-content.collapsed {
    display: none;
}

.summary-yes-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 50px;
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    letter-spacing: 0.03em;
}

.div-check-card:has(.is-invalid) {
    border-color: #dc3545 !important;
}

/* Mobile Floating Summary Button & Modal */
.mobile-summary-fab {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.58rem 0.95rem;
    border-radius: 50px;
    background-color: #0255a3;
    color: #ffffff;
    font-family: "Outfit", "Inter", sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 18px rgba(2, 85, 163, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.mobile-summary-fab:hover,
.mobile-summary-fab:focus {
    background-color: #014484;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(2, 85, 163, 0.45);
}

.mobile-summary-fab:active {
    transform: translateY(0);
}

#mobile-summary-modal-body #div-summary-card {
    border: 0 !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
}

#mobile-summary-modal-body #div-summary-card > .card-header {
    display: none !important;
}

/* Compact inline label + value layout on mobile (matching Summary) */
@media (max-width: 767.98px) {
    .compact-mobile-fields {
        --bs-gutter-y: 0;
        row-gap: 0 !important;
    }

    .compact-mobile-fields > [class*="col-"]:not(.field-group-header):not(.field-group-wrapper) {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.75rem;
        padding-top: 0.48rem;
        padding-bottom: 0.48rem;
        border-bottom: 1px solid #edf2f7;
    }

    .compact-mobile-fields > [class*="col-"]:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .compact-mobile-fields > .field-group-header {
        margin-top: 0.85rem !important;
        padding-top: 0.25rem;
        padding-bottom: 0.3rem;
        border-bottom: 1px solid #cbd5e1;
    }

    .compact-mobile-fields > .field-group-wrapper {
        padding-top: 0;
        padding-bottom: 0;
    }

    .compact-mobile-fields .field-label {
        margin-bottom: 0;
        flex-shrink: 0;
        font-size: 0.8rem;
        font-weight: 500;
        color: #64748b;
        text-transform: none;
        letter-spacing: 0;
    }

    .compact-mobile-fields .readonly-field {
        background-color: transparent;
        border: 0;
        border-radius: 0;
        padding: 0;
        min-height: auto;
        justify-content: flex-end;
        text-align: right;
        font-size: 0.85rem;
        font-weight: 600;
        color: #1e293b;
        min-width: 0;
        flex: 1 1 auto;
    }
}


