/* Survey embed normalization (applies in modal + full-page survey) */
#modal-backdrop .modal-body.iframe-lesson-mode {
    overflow: hidden;
    background: #fff;
}

#modal-backdrop .modal-body.iframe-lesson-mode .lesson-modal-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.survey-rich-text .survey-video-embed {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 0.5rem;
    margin: 0.75rem 0;
    background: #000;
    aspect-ratio: 16 / 9;
}

.survey-rich-text .survey-iframe-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin: 0.75rem 0;
}

.survey-rich-text .survey-embed-iframe {
    display: block;
    width: 100% !important;
    max-width: 100%;
    border: 0;
}

.survey-rich-text .survey-video-embed .survey-embed-iframe {
    position: absolute;
    inset: 0;
    height: 100% !important;
}

.survey-rich-text .survey-iframe-wrap .survey-embed-iframe {
    min-height: 320px;
}

.survey-rich-text .survey-pdf-embed {
    margin: 0.75rem 0 0.5rem;
    overflow: hidden;
    border-radius: 0.5rem;
}

.survey-rich-text .survey-pdf-iframe {
    display: block;
    width: 100%;
    aspect-ratio: 8.5 / 11;
    min-height: 420px;
    border: 0 !important;
    background: transparent;
}

.survey-rich-text .survey-pdf-open-link {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: #0369a1;
    text-decoration: underline;
}

.survey-question-prompt {
    padding: 0.5rem 0.65rem 0.2rem;
    border-radius: 0.5rem;
    background: #f8fafc;
}

.survey-question-prompt .survey-rich-text {
    font-weight: 600;
    color: #0f172a;
    line-height: 1.65;
}

.survey-answer-block {
    border: 1px solid #dbeafe;
    border-top-width: 2px;
    margin-top: 0.45rem;
    padding: 0.8rem 0.9rem 0.85rem;
    border-radius: 0.55rem;
    background: #f0f9ff;
}

.survey-answer-block label {
    font-weight: 500;
}

@media (max-width: 768px) {
    /* Prevent iOS focus-zoom on form fields */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
    textarea,
    select {
        font-size: 16px !important;
    }

    .navbar .container {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }

    .nav-logo-sm {
        display: inline-block;
    }

    .navbar-nav.social {
        display: none;
        flex: 1;
        justify-content: flex-start;
        gap: 10px;
        padding-left: 0;
        margin-top: 0;
        margin-bottom: 0;
    }

    .navbar-form {
        display: flex;
        flex: 1;
        justify-content: flex-end;
        margin-top: 1px;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    .navbar-form .form-group {
        margin-top: 1px;
        margin-right: 5px;
    }

    .navbar-form .form-control {
        display: none;
        width: 275px;
    }

    .dropdown-menu {
        position: static;
        top: auto;
        left: auto;
        float: none;
        max-width: none;
        padding: 0;
        margin: 0 15px;
        background-color: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    #modal-backdrop .modal-body iframe {
        height: calc(100vh - 2rem); /* fill standard modal content vertically */
    }

    #modal-backdrop .modal-body.iframe-lesson-mode {
        height: 100%;
        overflow: hidden;
    }

    #modal-backdrop .modal-body.iframe-lesson-mode .lesson-modal-iframe {
        display: block;
        width: 100%;
        height: 100% !important;
        min-height: 0;
    }

    .survey-rich-text .survey-iframe-wrap .survey-embed-iframe {
        min-height: 220px;
    }

    .survey-rich-text .survey-pdf-iframe {
        min-height: 50vh;
    }

    .survey-shell {
        -webkit-overflow-scrolling: touch;
    }

    .survey-shell .survey-rich-text {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .survey-shell input[type="checkbox"],
    .survey-shell input[type="radio"] {
        width: 1.05rem;
        height: 1.05rem;
    }

    .survey-question-prompt {
        padding: 0.45rem 0.55rem 0.1rem;
    }

    .survey-answer-block {
        margin-top: 0.4rem;
        padding: 0.65rem 0.7rem 0.75rem;
    }

    .achievements-panel-header {
        top: -1px;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        margin-bottom: 0;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .achievements-panel-content {
        padding-top: 0.6rem;
    }
}
