/* ============================================================================
   HEY LSIP — Survey System styles
   Public form + admin response viewer polish.
   ============================================================================ */

/* ── Public survey container ─────────────────────────────────────────────── */

.survey-panel {
    max-width: 780px;
    margin: 0 auto;
    background: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
    margin-top: -3rem;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .survey-panel {
        padding: 1.5rem 1.25rem;
        margin-top: -1.5rem;
        border-radius: 4px;
    }
}

.survey-panel h1 {
    margin-bottom: 1rem;
    line-height: 1.2;
}

.survey-description {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #444;
    padding: 1rem 1.25rem;
    background: #f8f8f4;
    border-left: 3px solid #28a745;
    border-radius: 4px;
}

.survey-description p:last-child {
    margin-bottom: 0;
}

/* ── Individual question field ───────────────────────────────────────────── */

.survey-field {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.survey-field:last-of-type {
    border-bottom: none;
}

.survey-field .rz-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #222;
    font-size: 1rem;
    line-height: 1.4;
}

/* Fieldset/legend used for grouped questions (choice + rating) — drop default styling */
fieldset.survey-field {
    border: 0;
    padding: 1rem 0;
    margin: 0;
}

.survey-legend {
    display: block;
    width: 100%;
    font-weight: 600;
    color: #222;
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    padding: 0;
}

/* Visually-hidden helper for screen-reader-only text */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

.survey-required {
    color: #c0392b;
    margin-left: 0.25rem;
    font-weight: 700;
}

.survey-help-text {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.survey-error {
    color: #c0392b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: #fdecea;
    border-radius: 4px;
}

/* ── Multi-choice checkbox list ──────────────────────────────────────────── */

.survey-multi .form-check {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.4rem;
    border-radius: 4px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.survey-multi .form-check:hover {
    background: #f4f8f5;
}

.survey-multi .form-check-input {
    margin-right: 0.6rem;
    cursor: pointer;
}

.survey-multi .form-check-label {
    cursor: pointer;
    user-select: none;
}

/* ── Rating pips ─────────────────────────────────────────────────────────── */

.survey-rating {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.survey-rating-pip {
    min-width: 48px;
    height: 48px;
    padding: 0 1rem;
    border-radius: 50%;
    border: 2px solid #ced4da;
    background: #fff;
    color: #555;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.survey-rating-pip:hover {
    border-color: #28a745;
    color: #28a745;
    transform: translateY(-1px);
}

.survey-rating-pip.selected {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.survey-rating-pip:focus {
    outline: 3px solid rgba(40, 167, 69, 0.35);
    outline-offset: 2px;
}

/* ── Radzen overrides inside the survey panel ────────────────────────────── */

.survey-panel .rz-textbox,
.survey-panel .rz-textarea {
    border-radius: 4px;
    border: 1px solid #ced4da;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
}

.survey-panel .rz-textbox:focus,
.survey-panel .rz-textarea:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

.survey-panel .rz-radio-button-list .rz-radio-button {
    margin-bottom: 0.5rem;
}

/* ── Admin response viewer — bar chart polish ────────────────────────────── */

.response-summary-bars {
    margin-top: 0.5rem;
}

/* ── Admin editor: tighten HTML editor wrap so resize works visibly ──────── */

.cms-html-wrap {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

.cms-html-wrap .rz-html-editor {
    border: none;
    flex: 1;
    min-height: 220px;
}

.cms-html-wrap .rz-html-editor-content {
    min-height: 160px;
}

/* ── Admin status strip: long URL should wrap, not overflow ──────────────── */

.survey-status-url {
    word-break: break-all;
    max-width: 100%;
}

/* ── Survey question card hover state ────────────────────────────────────── */

.survey-question-card {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.survey-question-card:hover {
    border-color: #b7d1bf !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
