/**
 * SLS shared image capture source chooser (Camera / Gallery / Files).
 * Classes keep student-style naming aliases for backward CSS hooks.
 */
.sls-image-capture-chooser,
.sls-student-photo-source-chooser {
    position: fixed;
    inset: 0;
    z-index: 2147482400;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}
.sls-image-capture-chooser.hidden,
.sls-student-photo-source-chooser.hidden {
    display: none !important;
}
.sls-image-capture-chooser__backdrop,
.sls-student-photo-source-chooser__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}
.sls-image-capture-chooser__panel,
.sls-student-photo-source-chooser__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border-radius: 1.25rem 1.25rem 0 0;
    background: #fff;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.22);
    box-sizing: border-box;
    animation: sls-image-capture-up 0.22s ease-out;
}
@media (min-width: 640px) {
    .sls-image-capture-chooser,
    .sls-student-photo-source-chooser {
        align-items: center;
        padding: 1.25rem;
    }
    .sls-image-capture-chooser__panel,
    .sls-student-photo-source-chooser__panel {
        border-radius: 1.25rem;
        margin: 0 1rem;
        animation: sls-image-capture-pop 0.2s ease-out;
    }
}
@keyframes sls-image-capture-up {
    from { transform: translateY(100%); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes sls-image-capture-pop {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.sls-image-capture-chooser__head,
.sls-student-photo-source-chooser__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
/* Force EN/AR toggle + close into one horizontal row (page CSS must not stack them). */
.sls-image-capture-chooser__lang-slot,
.sls-image-capture-chooser__head > [data-sls-popup-lang-slot],
.sls-student-photo-source-chooser__head > [data-sls-popup-lang-slot] {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-shrink: 0 !important;
}
.sls-image-capture-chooser__head .sls-popup-lang,
.sls-image-capture-chooser__head .sls-student-form-lang,
.sls-student-photo-source-chooser__head .sls-popup-lang,
.sls-student-photo-source-chooser__head .sls-student-form-lang {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.sls-image-capture-chooser__head .sls-popup-lang__btn,
.sls-image-capture-chooser__head .sls-student-form-lang__btn,
.sls-student-photo-source-chooser__head .sls-popup-lang__btn,
.sls-student-photo-source-chooser__head .sls-student-form-lang__btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0.28rem 0.65rem;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    cursor: pointer;
    width: auto !important;
}
.sls-image-capture-chooser__head .sls-popup-lang__btn + .sls-popup-lang__btn,
.sls-image-capture-chooser__head .sls-student-form-lang__btn + .sls-student-form-lang__btn,
.sls-student-photo-source-chooser__head .sls-popup-lang__btn + .sls-popup-lang__btn,
.sls-student-photo-source-chooser__head .sls-student-form-lang__btn + .sls-student-form-lang__btn {
    border-inline-start: 1px solid #cbd5e1 !important;
}
.sls-image-capture-chooser__head .sls-popup-lang__btn.is-active,
.sls-image-capture-chooser__head .sls-student-form-lang__btn.is-active,
.sls-student-photo-source-chooser__head .sls-popup-lang__btn.is-active,
.sls-student-photo-source-chooser__head .sls-student-form-lang__btn.is-active {
    background: #0d9488;
    color: #fff;
}
.sls-image-capture-chooser__title,
.sls-student-photo-source-chooser__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f766e;
    letter-spacing: 0.01em;
}
.sls-image-capture-chooser__hint,
.sls-student-photo-source-chooser__hint {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.4;
}
.sls-image-capture-chooser__close,
.sls-student-photo-source-chooser__close {
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.sls-image-capture-chooser__close:hover,
.sls-image-capture-chooser__close:focus-visible,
.sls-student-photo-source-chooser__close:hover,
.sls-student-photo-source-chooser__close:focus-visible {
    background: #e2e8f0;
    color: #0f172a;
    outline: none;
}
.sls-image-capture-chooser__actions,
.sls-student-photo-source-chooser__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.sls-image-capture-chooser__actions--with-file {
    grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 420px) {
    .sls-image-capture-chooser__actions--with-file {
        grid-template-columns: 1fr;
    }
}
.sls-image-capture-chooser__btn,
.sls-student-photo-source-chooser__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 7.25rem;
    padding: 1rem 0.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 118, 110, 0.18);
    background: linear-gradient(180deg, #f8fffe 0%, #f0fdfa 100%);
    color: #0f766e;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.sls-image-capture-chooser__btn:hover,
.sls-image-capture-chooser__btn:focus-visible,
.sls-student-photo-source-chooser__btn:hover,
.sls-student-photo-source-chooser__btn:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(13, 148, 136, 0.45);
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.14);
    outline: none;
}
.sls-image-capture-chooser__btn--gallery,
.sls-student-photo-source-chooser__btn--gallery {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: rgba(100, 116, 139, 0.22);
    color: #334155;
}
.sls-image-capture-chooser__btn--gallery:hover,
.sls-image-capture-chooser__btn--gallery:focus-visible,
.sls-student-photo-source-chooser__btn--gallery:hover,
.sls-student-photo-source-chooser__btn--gallery:focus-visible {
    border-color: rgba(71, 85, 105, 0.4);
    box-shadow: 0 10px 24px rgba(51, 65, 85, 0.12);
}
.sls-image-capture-chooser__btn--file {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    border-color: rgba(99, 102, 241, 0.22);
    color: #3730a3;
}
.sls-image-capture-chooser__btn--file:hover,
.sls-image-capture-chooser__btn--file:focus-visible {
    border-color: rgba(79, 70, 229, 0.4);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12);
}
.sls-image-capture-chooser__icon,
.sls-student-photo-source-chooser__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.28);
}
.sls-image-capture-chooser__btn--gallery .sls-image-capture-chooser__icon,
.sls-student-photo-source-chooser__btn--gallery .sls-student-photo-source-chooser__icon {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow: 0 8px 18px rgba(71, 85, 105, 0.25);
}
.sls-image-capture-chooser__btn--file .sls-image-capture-chooser__icon {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.25);
}
.sls-image-capture-chooser__label,
.sls-student-photo-source-chooser__label {
    font-size: 0.875rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.25;
}
.sls-image-capture-chooser__cancel,
.sls-student-photo-source-chooser__cancel {
    display: block;
    width: 100%;
    margin-top: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 800;
    cursor: pointer;
}
.sls-image-capture-chooser__cancel:hover,
.sls-image-capture-chooser__cancel:focus-visible,
.sls-student-photo-source-chooser__cancel:hover,
.sls-student-photo-source-chooser__cancel:focus-visible {
    background: #f8fafc;
    color: #0f172a;
    outline: none;
}
[dir="rtl"] .sls-image-capture-chooser__head,
[dir="rtl"] .sls-student-photo-source-chooser__head {
    direction: rtl;
}
.sls-image-capture-hidden-inputs {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
