:root {
    color-scheme: light;
}

body {
    background-color: #f8f9fa;
    color: #1f2937;
}

input,
select,
textarea {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(30, 64, 175, 0.12);
    background: rgba(248, 249, 250, 0.9);
    padding: 0.9rem 1rem;
    color: #1f2937;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(30, 64, 175, 0.35);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.08);
    background: #ffffff;
}

.language-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.language-select-wrap-full {
    display: flex;
    width: 100%;
}

.language-select {
    width: auto;
    min-width: 5.75rem;
    min-height: 2.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(30, 64, 175, 0.16);
    background-color: #ffffff;
    box-shadow: 0 8px 22px rgba(30, 64, 175, 0.08);
    color: #1f2937;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none !important;
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 0 0;
    line-height: 1.2;
    text-indent: 0.01px;
    text-overflow: "";
    padding-right: 2.7rem;
}

.language-select:hover {
    border-color: rgba(30, 64, 175, 0.24);
    background-color: #ffffff;
}

.language-select:focus,
.language-select:active {
    border-color: rgba(30, 64, 175, 0.35);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.08);
}

.language-select-full {
    width: 100%;
    min-width: 0;
    border-radius: 1rem;
    min-height: 3rem;
    padding-right: 2.9rem;
}

.language-select::-ms-expand {
    display: none;
}

.language-select-icon {
    position: absolute;
    right: 0.95rem;
    top: 50%;
    display: inline-flex;
    width: 0.875rem;
    height: 0.875rem;
    color: #1e40af;
    transform: translateY(-50%);
    pointer-events: none;
}

.language-select-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.site-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.58) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.58) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.28), transparent 70%);
    pointer-events: none;
}

.hero-balanced-text {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    text-wrap: pretty;
}

.about-page-grid {
    display: grid;
    gap: 1.25rem;
}

.about-main-card {
    order: 1;
}

.about-photo-card {
    order: 2;
}

.about-detail-grid {
    order: 3;
}

@media (min-width: 1024px) {
    .about-page-grid {
        grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
        grid-template-rows: auto minmax(0, 1fr);
        align-items: start;
    }

    .about-photo-card {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    .about-main-card {
        grid-column: 2;
        grid-row: 1;
    }

    .about-detail-grid {
        grid-column: 2;
        grid-row: 2;
        align-self: stretch;
    }
}

.cta-pulse {
    animation: cta-pulse 2.8s ease-in-out infinite;
}

.footer-social-button {
    align-items: center;
    background: rgba(248, 249, 250, 0.9);
    border-radius: 9999px;
    color: #1f2937;
    display: inline-flex;
    gap: 0.75rem;
    justify-content: center;
    min-height: 3rem;
    min-width: 9.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.footer-social-button:hover {
    background: #1e40af;
    color: #ffffff;
}

.footer-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    min-width: 1rem;
    height: 1rem;
    font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
}

.social-brand-icon,
.footer-social-icon svg {
    display: block;
    height: 100%;
    width: 100%;
}

@media (max-width: 767px) {
    .home-courses-grid > [data-home-card="course"]:not([data-home-index="1"]):not([data-home-index="2"]):not([data-home-index="3"]),
    .home-tests-grid > [data-home-card="test"]:not([data-home-index="1"]):not([data-home-index="2"]):not([data-home-index="3"]),
    .home-materials-grid > [data-home-card="material"]:not([data-home-index="1"]):not([data-home-index="2"]):not([data-home-index="3"]) {
        display: none !important;
    }
}

.course-card-text-safe {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
}

.material-title-safe,
.material-description-safe,
.material-detail-text-safe {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
}

.test-title-safe,
.test-description-safe,
.test-question-safe,
.test-option-safe,
.test-explanation-safe {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
}

.test-question-card {
    scroll-margin-top: 7rem;
}

@media (max-width: 1023px) {
    .test-run-form {
        padding-bottom: 7.25rem;
    }

    .test-control-panel {
        position: fixed;
        z-index: 45;
        right: 0;
        bottom: 0;
        left: 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 1.5rem 1.5rem 0 0;
        background: rgba(255, 255, 255, 0.96);
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
        box-shadow: 0 -18px 42px rgba(15, 23, 42, 0.14);
        backdrop-filter: blur(14px);
    }

    .test-control-heading,
    .test-control-copy {
        display: none;
    }

    .test-action-row {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0;
    }

    .test-action-button {
        min-height: 2.75rem;
        width: 100%;
        padding: 0.65rem 1rem;
        font-size: 0.8125rem;
        line-height: 1.15rem;
    }

    .test-action-next {
        order: 1;
    }

    .test-action-finish {
        order: 2;
    }

    .test-action-admin {
        order: 3;
        min-height: 2.25rem;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 767px) {
    .test-question-card {
        border-radius: 1.5rem;
        padding: 1.25rem;
    }

    .test-answer-option {
        gap: 0.75rem;
        border-radius: 1.25rem;
        padding: 0.875rem 1rem;
        line-height: 1.55;
    }
}

@keyframes cta-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.18);
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 0 0 14px rgba(250, 204, 21, 0);
        transform: translateY(-1px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cta-pulse {
        animation: none;
    }
}
