.icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
}

.icon-sm {
    width: 18px;
    height: 18px;
}

.icon-lg {
    width: 32px;
    height: 32px;
}

.btn_close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--c-text-muted);
    transition: color 0.2s;
    padding: 5px;
}

.btn_close:hover {
    color: var(--c-text-main);
}

.progress_track {
    flex: 1;
    height: 12px;
    background-color: #2e2e2e;
    border-radius: 10px;
    overflow: hidden;
}

.progress_fill {
    height: 100%;
    background-color: var(--c-accent-green);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lesson_task_area {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.task_wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--content-max-width);
    height: 100%;
    justify-content: center;
    margin: 0px auto;
}

.lesson_layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
}

.l_header {
    height: var(--header-height);
    flex-shrink: 0;
    background-color: var(--c-bg-body);
    display: flex;
    justify-content: center;
    z-index: 2;
}

.l_header_inner {
    width: 100%;
    max-width: var(--content-max-width);
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.l_main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    min-height: 0;
}


.l_footer {
    flex-shrink: 0;
    background-color: var(--c-bg-footer);
    border-top: 2px solid var(--c-border);
    height: var(--footer-height);
    display: flex;
    align-items: flex-end;
}

.l_footer_inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(var(--btn-bottom-gap) + env(safe-area-inset-bottom));
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 24px;
    width: 100%;
}

.l_footer_inner>*+* {
    margin-top: 24px;
}




.btn_action:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.btn_action.is_check {
    background-color: var(--c-accent-green);
}

.btn_action.is_continue {
    background-color: var(--c-accent-green);
}

.btn_action.is_error {
    background-color: var(--c-accent-red);
}

.btn_report_mini {
    background: none;
    border: none;
    padding-top: 2px;
    cursor: pointer;
    color: var(--c-text-muted);
    opacity: 0.6;
    display: flex;
    align-items: center;
}
.btn_report_mini:hover { opacity: 1; color: var(--c-accent-red); }



.btn_action:disabled,
.btn_action.is_disabled {
    background-color: #333333;
    color: #777777;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.btn_action.is_disabled, 
.btn_action:disabled {
    filter: grayscale(1) !important;
    opacity: 0.5 !important;
    background-color: #333 !important;
    color: #777 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
}



.btn_action {
    width: 100%;
    max-width: var(--action_button-max-width);
    margin: 0 auto;
    padding: 16px;
    border-radius: 16px;
    border: none;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    background-color: var(--c-accent-blue);
    /* Дефолтный цвет */
    color: white;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
    /* Эффект объема */
}

@media (max-width: 700px) {
    /* 1. Убираем центрирование у главного контейнера */
    .l_main {
        justify-content: flex-start; 
    }

    /* 2. Убираем центрирование у обертки задания и добавляем отступ */
    .task_wrapper {
        justify-content: flex-start;
    }
    
    /* 3. Опционально: если экран совсем низкий (менее 600px), 
       можно вернуть инструкцию, так как теперь места сверху больше */
    .task_instruction_label {
        display: block; 
    }
}



/* --- ОВЕРЛЕЙ ОБРАТНОЙ СВЯЗИ (Success/Error) --- */
.feedback_overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    /* Паддинг снизу учитывает безопасную зону на iPhone */
    padding-bottom: env(safe-area-inset-bottom);
    transition: transform 0.2s ease-in, opacity 0.2s ease-in;
    opacity: 0;
    padding-bottom: env(safe-area-inset-bottom);
}

.feedback_overlay.is_active {
    transform: translateY(0);
    opacity: 1;
    /* Появление можно сделать чуть медленнее и "пружинистее" */
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease-out;
}

/* Специфические цвета для состояний */
.state_success {
    background-color: var(--c-success-bg);
}

.state_error {
    background-color: var(--c-error-bg);
}

.feedback_box {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 50px;
    width: 100%;
    max-width: var(--action_button-max-width);
    margin: 0px auto;
}

.feedback_content {
    display: flex;
    flex-direction: column;
}

.feedback_title {
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.state_success .feedback_title { color: var(--c-accent-green); }
.state_error .feedback_title { color: var(--c-accent-red); }

.feedback_answer {
    margin-top: 8px;
    margin-bottom: 20px;
    color: white;
    font-size: 16px;
    opacity: 0.9;
}

.feedback_answer b {
    font-weight: 800;
    color: var(--c-accent-red); /* Делаем сам текст ошибки красным */
}


.report_options {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.report_options .c_option {
    justify-content: center;
    text-align: center;
    padding: 16px;
    min-height: 54px;
    margin-left: 0 !important;
    transition: transform 0.1s, border-color 0.2s;
    margin-top: 0;
}

.report_options .c_option + .c_option {
    margin-top: 10px;
}

.report_options .c_option:hover {
    transform: translateY(-1px);
    background-color: #2a2a2a;
}

#popup_report_task .c_input_field {
    margin-top: 12px;
    width: 100%;
    min-height: 100px;
    background-color: #1a1a1a;
    border: 2px solid var(--c-border);
    border-radius: 12px;
    padding: 14px;
    color: white;
    font-size: 15px;
    resize: none;
}

#popup_report_task .c_input_field:focus {
    border-color: var(--c-accent-blue);
    outline: none;
}

.quit_lesson_box {
    text-align: center;
    padding: 10px 0;
}

.quit_icon_wrap {
    width: 80px;
    height: 80px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    color: var(--c-accent-red);
}

.quit_icon_wrap .g_icon {
    width: 40px;
    height: 40px;
}

.quit_title {
    color: white;
    font-size: 20px;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 12px;
}

.quit_desc {
    color: var(--c-text-muted); /* #8e8e8e */
    line-height: 1.5;
    margin-bottom: 32px;
}

.quit_actions {
    display: flex;
    flex-direction: column;
}

.quit_actions .btn_action + .btn_action {
    margin-top: 12px;
}

.btn_action.is_secondary {
    background: transparent;
    border: 2px solid #333;
    color: var(--c-text-muted);
    box-shadow: none; /* Убираем стандартную тень, если она есть */
}

.btn_action.is_secondary:hover {
    border-color: white;
    color: white;
}

.btn_action.is_secondary:active {
    transform: translateY(2px);
}
