/* ======================
   RESET & BASE
====================== */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: #f7f9fb; /* warmer neutral */
    color: #0f172a;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

/* ======================
   DISCLAIMER MODAL
====================== */
.disclaimer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.disclaimer-overlay.visible {
    display: flex;
}

.disclaimer-modal {
    background: #ffffff;
    border-radius: 14px;
    border-top: 4px solid #9bbfb3;
    box-shadow:
        0 8px 24px rgba(15,23,42,0.12),
        0 24px 48px rgba(15,23,42,0.18);
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    padding: 28px;
    overflow-y: auto;
}

.disclaimer-modal h2 {
    margin: 0 0 16px 0;
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
}

.disclaimer-body p {
    font-size: 14px;
    color: #334155;
    margin: 0 0 12px 0;
    line-height: 1.55;
}

.disclaimer-body p strong {
    color: #1e293b;
}

.btn-acknowledge {
    display: block;
    margin: 20px auto 0;
    background: linear-gradient(135deg, #5f8f84, #4d7c6f);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-acknowledge:hover {
    filter: brightness(1.05);
}

@media (max-width: 480px) {
    .disclaimer-modal {
        padding: 18px;
        max-height: 90vh;
    }

    .disclaimer-modal h2 {
        font-size: 16px;
    }
}

/* ======================
   HEADER
====================== */
.app-header {
    background: linear-gradient(180deg, #ffffff, #eef7f4); /* sage wash */
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 32px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    width: 44px;
    height: 44px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.header-left p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

/* ======================
   PAGE CONTAINER
====================== */
.container {
    width: 100%;
    max-width: none;          /* remove centering constraint */
    margin: 0;                /* no auto-centering */
    padding: 24px 32px;       /* responsive side gutters */
}


/* ======================
   CARD BASE
====================== */
.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 26px;
    border: 1px solid #e6ecef;
    border-top: 4px solid #9bbfb3; /* muted sage */
    box-shadow:
        0 2px 6px rgba(15,23,42,0.04),
        0 8px 24px rgba(15,23,42,0.05);
}

.card h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.card p {
    font-size: 14px;
    color: #334155;
    margin: 6px 0;
}

.card-header h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* ======================
   CARD HEADER
====================== */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ======================
   BUTTONS
====================== */
.btn-reset {
    background-color: #f1f5f4;
    color: #475569;
    border: 1px solid #d1e3dc;
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 14px;
    cursor: pointer;
}

.btn-reset:hover {
    background-color: #e6f0ec;
}

form button[type="submit"] {
    background: linear-gradient(135deg, #5f8f84, #4d7c6f); /* sage CTA */
    color: #ffffff;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
}

form button[type="submit"]:hover {
    filter: brightness(1.05);
}

form button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ======================
   RADIO BUTTONS
====================== */
.radio {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 1px solid #e3e8ee;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
}

.radio:hover {
    background: #f3f1ff; /* lavender */
    border-color: #c7c3f4;
}

.radio input {
    margin-top: 4px;
    accent-color: #7c6edb; /* lavender focus */
}

.radio-text strong {
    font-size: 14px;
    font-weight: 600;
}

.radio-text small {
    font-size: 12px;
    color: #64748b;
}

.input-section {
    display: block;             /* ensures it takes full width */
    width: 100%;
    margin: 2px 0 2px;       /* spacing above and below */
    font-weight: 700;
    font-size: 16px;            /* larger text for header feel */
    color: #1e293b;
    padding: 8px 0;             /* vertical padding only */
    border-bottom: 2px solid #7c6edb; /* underline style */
    text-transform: uppercase;  /* optional for section headers */
    letter-spacing: 0.5px;
}

/* Make all inputs in this section full-width on their own line */
#model-inputs label {
    flex: 1 1 100%;            /* force each input to take full width */
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;       /* spacing between inputs */
}

.req {
    color: #d32f2f;
    font-size: 0.85em;
    vertical-align: super;
}

.label-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.range-hint {
  font-size: 0.8rem;
  color: #6b7280; /* muted gray */
  margin-left: 6px;
  font-weight: normal;
}
.error-msg {
    color: #d32f2f;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.input-error {
    border: 1px solid #d32f2f;
}


/* ======================
   INPUT + OUTPUT LAYOUT
====================== */
.form-output-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Input form: two columns */
#model-inputs {
    flex: 1 1 60%;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid #dbe6e2;
    background: linear-gradient(180deg, #eef7f4, #ffffff 40%);
}

/* Two columns inside form */
#model-inputs label {
    flex: 1 1 calc(50% - 16px);
    display: flex;
    flex-direction: column;
}

#model-inputs label strong {
    font-size: 13px;
    font-weight: 600;
}

#model-inputs label small {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

#model-inputs input,
#model-inputs select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background-color: #fbfdfc;
}

#model-inputs input:focus,
#model-inputs select:focus {
    outline: none;
    border-color: #7c6edb;
    box-shadow: 0 0 0 3px rgba(124,110,219,0.18);
}

/* Right-side prediction panel */
#prediction-output {
    flex: 1 1 38%;
    min-width: 320px;
}

#prediction-output .card {
    margin-bottom: 20px;
}

/* ======================
   CONSENT SWITCH
====================== */
.switch-label {
    font-size: 14px;
    font-weight: 600;
    color: #92400e; /* amber */
}

.switch input:checked + .slider {
    background-color: #d97706;
}

/* ======================
   TABLES
====================== */
.input-table,
.feature-values-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
    border-radius: 10px;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.input-table th,
.feature-values-table th {
    background: #f3f4f6;
    color: #334155;
    padding: 10px 12px;
    font-weight: 600;
}

.input-table th,
.input-table td,
.feature-values-table th,
.feature-values-table td {
    text-align: center;
    vertical-align: middle;
}

.input-table tbody tr:nth-child(even),
.feature-values-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

/* ======================
   STATUS INDICATORS
====================== */
.trend-indicator {
    display: grid;
    grid-template-columns: 48px 1fr; /* arrow column + text */
    align-items: center;
    column-gap: 12px;
    margin-bottom: 12px;
}

/* Arrow spans visually ~2 text lines */
.trend-up,
.trend-down {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.6em;        /* forces 2-line height */
    font-size: 20px;
    font-weight: 700;
    border-radius: 999px;
}

/* Colors */
.trend-up {
    color: #166534;
    background: #f0fdf4;
}

.trend-down {
    color: #9f1239;
    background: #fff1f2;
}

.trend-text {
    line-height: 1.3;
}

/* ======================
   TWO-COLUMN FLEX FOR HTMX LOADED INPUT/OUTPUT
====================== */
.grid {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    flex-wrap: nowrap; /* side-by-side by default */
}

/* INPUT PANEL (left) */
.grid > div:nth-child(1) {
    flex: 1 1 58%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* OUTPUT PANEL (right) */
.grid > div:nth-child(2) {
    flex: 1 1 40%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Ensure cards inside panels stretch */
.grid > div > .card {
    width: 100%;
}
/* ======================
   FOOTER
====================== */
.app-footer {
    margin-top: 48px;
    padding: 20px 32px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.footer-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

/* ======================
   RESPONSIVE
====================== */
@media (max-width: 992px) {
    .form-output-wrapper {
        flex-direction: column;
    }

    #model-inputs,
    #prediction-output {
        flex: 1 1 100%;
    }

    #model-inputs label {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .btn-reset,
    form button[type="submit"] {
        width: 100%;
        text-align: center;
    }

    .card {
        padding: 18px;
    }

    .card h2 {
        font-size: 15px;
    }
    .container {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    html, body {
        font-size: 14px;
    }

    .container {
        padding: 12px;
    }

    .app-header {
        padding: 14px;
    }

    .header-left h1 {
        font-size: 16px;
    }

    .logo {
        width: 36px;
        height: 36px;
    }

    #model-inputs {
        padding: 16px;
        gap: 10px;
    }

    #model-inputs input,
    #model-inputs select {
        padding: 8px 10px;
    }

    .card {
        border-radius: 10px;
        padding: 16px;
    }

    .radio {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .radio-text strong {
        font-size: 13px;
    }
}


/* RESPONSIVE: stack vertically on smaller screens */
@media (max-width: 992px) {
    .grid {
        flex-direction: column;
    }

    .grid > div:nth-child(1),
    .grid > div:nth-child(2) {
        flex: 1 1 100%;
        min-width: auto;
    }
}

