.survey-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1050;
    font-family: "Source Sans Pro", Arial, sans-serif;
}

.survey-launcher {
    border: 0;
    background: #14532d;
    color: #fff;
    min-height: 52px;
    padding: 0 18px;
    border-radius: 8px;
    box-shadow: 0 18px 35px rgba(5, 20, 12, 0.28);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0;
}

.survey-launcher i {
    font-size: 18px;
}

.survey-panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: min(440px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 112px));
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.survey-panel.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.survey-panel-header {
    background: #0f2f1f;
    color: #fff;
    padding: 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.survey-panel-header strong {
    display: block;
    font-size: 17px;
    line-height: 1.25;
}

.survey-panel-header p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    line-height: 1.4;
}

.survey-close {
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex: 0 0 auto;
}

.survey-form {
    padding: 18px;
}

.survey-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.survey-grid .form-group:first-child,
.survey-grid .form-group:nth-child(2),
.survey-grid .form-group:nth-child(3),
.survey-grid .form-group:nth-child(4) {
    grid-column: span 2;
}

.survey-form label {
    font-size: 12px;
    color: #263238;
    font-weight: 700;
    margin-bottom: 6px;
}

.survey-form label span {
    color: #6b7280;
    font-weight: 600;
}

.survey-form .form-control {
    border-radius: 6px;
    font-size: 13px;
}

.survey-questions {
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
    padding-top: 12px;
}

.survey-question-set {
    display: none;
}

.survey-question {
    padding: 12px 0;
    border-bottom: 1px solid #eef2f7;
}

.survey-question > label {
    display: block;
    font-size: 13px;
    line-height: 1.4;
}

.rating-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin: 8px 0;
}

.rating-pill {
    margin: 0;
}

.rating-pill input {
    position: absolute;
    opacity: 0;
}

.rating-pill span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #1f2937;
    font-weight: 700;
    cursor: pointer;
}

.rating-pill input:checked + span {
    border-color: #14532d;
    background: #dcfce7;
    color: #14532d;
}

.survey-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    margin: 12px 0;
}

.evaluation-toast {
    position: fixed;
    right: 24px;
    bottom: 92px;
    z-index: 1060;
    background: #14532d;
    color: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 18px 35px rgba(5, 20, 12, 0.26);
    display: flex;
    align-items: center;
    gap: 8px;
}

.evaluation-qr-body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(rgba(8, 24, 18, 0.82), rgba(8, 24, 18, 0.9)),
        url('../images/military-bg.jpg') center/cover no-repeat;
    color: #fff;
}

.evaluation-qr-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
}

.evaluation-qr-card {
    width: min(520px, 100%);
    background: rgba(15, 23, 42, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
}

.evaluation-qr-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.evaluation-qr-header img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.evaluation-qr-header h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: 0;
}

.evaluation-qr-header p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.76);
}

.evaluation-qr-box {
    width: 260px;
    min-height: 260px;
    margin: 0 auto 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.evaluation-qr-box img,
.evaluation-qr-box canvas {
    max-width: 100%;
    height: auto;
}

.evaluation-download-qr {
    margin: -6px 0 18px;
}

.evaluation-qr-fallback {
    color: #0f172a;
    word-break: break-all;
    text-align: center;
    font-weight: 700;
}

.evaluation-token {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    margin-bottom: 18px;
}

.evaluation-token span,
.evaluation-qr-meta span {
    display: block;
    color: rgba(255, 255, 255, 0.66);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
}

.evaluation-token strong {
    display: block;
    margin-top: 4px;
    color: #fff;
    font-size: 15px;
    word-break: break-all;
}

.evaluation-qr-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.evaluation-qr-meta div {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px;
}

.evaluation-qr-meta strong {
    display: block;
    margin-top: 3px;
    color: #fff;
    font-size: 13px;
}

.survey-validation-hero {
    align-items: center;
}

.survey-validation-hero h3 {
    margin-bottom: 8px;
}

.survey-validation-hero p {
    max-width: 760px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.78);
}

.survey-validation-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 18px;
}

.survey-qr-reader {
    overflow: hidden;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    min-height: 280px;
    background: #f8fafc;
}

.survey-qr-upload-reader {
    display: none;
}

.survey-qr-upload {
    margin-top: 16px;
}

.survey-qr-upload label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.manual-validation-form {
    margin-top: 18px;
}

.manual-validation-form label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.survey-validation-message {
    margin-top: 14px;
    border-radius: 6px;
    padding: 10px 12px;
}

.survey-scanner-card {
    align-self: start;
}

.course-builder {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.course-panel {
    border: 1px solid #d8dee9;
    border-radius: 8px;
    background: #f8fafc;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.course-panel.selected {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.course-panel-head {
    padding: 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.course-panel-head strong {
    white-space: nowrap;
    color: #1f2937;
}

.course-panel-head .course-search {
    max-width: 180px;
}

.course-list {
    padding: 10px;
    overflow: auto;
    flex: 1;
}

.course-item {
    width: 100%;
    border: 1px solid transparent;
    background: #fff;
    color: #1f2937;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    cursor: pointer;
}

.course-item span {
    font-weight: 700;
    line-height: 1.3;
}

.course-item small {
    color: #64748b;
    flex: 0 0 auto;
}

.course-item.is-selected {
    border-color: #166534;
    background: #dcfce7;
    color: #14532d;
}

.course-builder-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

@media (max-width: 575.98px) {
    .survey-widget {
        right: 16px;
        bottom: 16px;
    }

    .survey-launcher span {
        display: none;
    }

    .survey-launcher {
        min-width: 54px;
        justify-content: center;
        padding: 0 14px;
    }

    .survey-grid {
        grid-template-columns: 1fr;
    }

    .survey-grid .form-group:first-child,
    .survey-grid .form-group:nth-child(2),
    .survey-grid .form-group:nth-child(3),
    .survey-grid .form-group:nth-child(4) {
        grid-column: span 1;
    }
}

@media (max-width: 991.98px) {
    .survey-validation-grid {
        grid-template-columns: 1fr;
    }

    .course-builder {
        grid-template-columns: 1fr;
    }

    .course-builder-actions {
        flex-direction: row;
    }
}

@media (max-width: 575.98px) {
    .evaluation-qr-card {
        padding: 18px;
    }

    .evaluation-qr-header {
        align-items: flex-start;
    }

    .evaluation-qr-header h1 {
        font-size: 20px;
    }

    .evaluation-qr-meta {
        grid-template-columns: 1fr;
    }
}
