:root {
    --det-blue: #1d4ed8;
    --det-navy: #0f172a;
    --det-green: #059669;
    --det-muted: #64748b;
    --det-border: #e2e8f0;
    --det-bg: #f8fafc;
}

.det-page,
.det-page * {
    box-sizing: border-box;
}

.det-page {
    direction: rtl;
    min-height: 100vh;
    background: var(--det-bg);
    color: var(--det-navy);
    line-height: 1.85;
}

.det-container {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.det-hero {
    padding: 76px 0;
    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(59, 130, 246, .45),
            transparent 34%
        ),
        linear-gradient(
            135deg,
            #0f172a,
            #172554 55%,
            #1e3a8a
        );
    color: #fff;
}

.det-hero-grid,
.det-two-column {
    display: grid;
    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(310px, .85fr);
    gap: 34px;
    align-items: center;
}

.det-eyebrow {
    margin: 0;
    color: #93c5fd;
    font-weight: 800;
}

.det-title {
    margin: 10px 0 0;
    font-size: clamp(
        34px,
        5vw,
        62px
    );
    line-height: 1.25;
    font-weight: 900;
}

.det-lead {
    margin-top: 20px;
    max-width: 820px;
    color: #dbeafe;
    font-size: 18px;
}

.det-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.det-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 12px 22px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    font-weight: 900;
}

.det-button-primary {
    background: var(--det-green);
    color: #fff;
}

.det-button-blue {
    background: var(--det-blue);
    color: #fff;
}

.det-button-light {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: var(--det-navy);
}

.det-button-ghost {
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.det-button:disabled {
    cursor: not-allowed;
    opacity: .4;
}

.det-hero-panel {
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 26px;
    background: rgba(255, 255, 255, .09);
    box-shadow:
        0 26px 70px
        rgba(2, 6, 23, .35);
}

.det-grid-2,
.det-grid-3,
.det-grid-4,
.det-status-grid,
.det-result-grid {
    display: grid;
    gap: 16px;
}

.det-grid-2 {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.det-grid-3 {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

.det-grid-4 {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
}

.det-status-grid,
.det-result-grid {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

.det-card,
.det-box,
.det-stat,
.det-status,
.det-result-stat {
    border: 1px solid var(--det-border);
    border-radius: 20px;
    background: #fff;
}

.det-card,
.det-box {
    padding: 24px;
}

.det-stat,
.det-status,
.det-result-stat {
    padding: 18px;
}

.det-stat small,
.det-status small,
.det-result-stat small {
    display: block;
    color: var(--det-muted);
}

.det-stat strong,
.det-status strong,
.det-result-stat strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
}

.det-panel-note {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid rgba(110, 231, 183, .3);
    border-radius: 18px;
    background: rgba(16, 185, 129, .1);
    color: #d1fae5;
}

.det-section {
    padding: 60px 0;
}

.det-section-white {
    border-block: 1px solid var(--det-border);
    background: #fff;
}

.det-section-head {
    max-width: 850px;
    margin-bottom: 28px;
}

.det-section-head > p:first-child {
    margin: 0;
    color: var(--det-blue);
    font-weight: 900;
}

.det-section-head h2 {
    margin: 8px 0 0;
    font-size: clamp(
        28px,
        4vw,
        42px
    );
    line-height: 1.35;
}

.det-section-head > p:last-child,
.det-card p,
.det-box p {
    color: #475569;
}

.det-card h3,
.det-box h2,
.det-box h3 {
    margin-top: 0;
    line-height: 1.5;
}

.det-link {
    color: var(--det-blue);
    text-decoration: none;
    font-weight: 900;
}

.det-dark {
    padding: 50px 0;
    background: var(--det-navy);
    color: #fff;
}

.det-dark p {
    color: #cbd5e1;
}

.det-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 24px;
    color: var(--det-muted);
    font-size: 14px;
}

.det-breadcrumb a {
    color: var(--det-blue);
    text-decoration: none;
}

.det-article-header {
    padding: 34px 0 26px;
}

.det-article-header h1 {
    margin: 8px 0 0;
    font-size: clamp(
        34px,
        5vw,
        54px
    );
    line-height: 1.3;
}

.det-article-header p {
    max-width: 850px;
    color: #475569;
    font-size: 18px;
}

.det-stack {
    display: grid;
    gap: 18px;
}

.det-notice {
    padding: 22px;
    border: 1px solid #fde68a;
    border-radius: 20px;
    background: #fffbeb;
    color: #78350f;
}

.det-setup {
    padding: 46px 0 70px;
}

.det-message {
    margin-top: 18px;
    padding: 16px;
    border-radius: 14px;
}

.det-message-success {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #065f46;
}

.det-message-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.det-hidden {
    display: none !important;
}

.det-test-wrap {
    padding: 34px 0 64px;
}

.det-test-card {
    overflow: hidden;
    border: 1px solid var(--det-border);
    border-radius: 24px;
    background: #fff;
    box-shadow:
        0 18px 50px
        rgba(15, 23, 42, .08);
}

.det-test-head,
.det-test-body {
    padding: 24px;
}

.det-test-head {
    border-bottom: 1px solid var(--det-border);
}

.det-test-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.det-timer {
    min-width: 132px;
    padding: 10px 16px;
    border-radius: 16px;
    background: var(--det-navy);
    color: #fff;
    text-align: center;
}

.det-timer small {
    display: block;
    color: #cbd5e1;
}

.det-timer strong {
    display: block;
    font-size: 25px;
    direction: ltr;
}

.det-progress {
    height: 8px;
    margin-top: 20px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.det-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--det-blue);
}

.det-progress-label {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: var(--det-muted);
    font-size: 14px;
}

.det-task-label {
    margin: 0;
    color: var(--det-blue);
    font-weight: 900;
}

.det-instruction {
    margin: 6px 0 0;
    font-size: 24px;
}

.det-passage,
.det-audio,
.det-recorder {
    margin-top: 20px;
    padding: 20px;
    border-radius: 18px;
}

.det-passage {
    border: 1px solid var(--det-border);
    background: #f8fafc;
    direction: ltr;
    text-align: left;
    white-space: pre-line;
}

.det-audio {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
}

.det-recorder {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
}

.det-image {
    display: block;
    width: 100%;
    max-height: 420px;
    margin-top: 20px;
    border: 1px solid var(--det-border);
    border-radius: 20px;
    background: #fff;
    object-fit: contain;
}

.det-prompt {
    margin-top: 22px;
    direction: ltr;
    text-align: left;
    font-size: 20px;
    font-weight: 800;
}

.det-options {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.det-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--det-border);
    border-radius: 15px;
    cursor: pointer;
}

.det-option:hover {
    border-color: #60a5fa;
    background: #eff6ff;
}

.det-option span {
    direction: ltr;
    text-align: left;
}

.det-textarea {
    width: 100%;
    min-height: 180px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    outline: none;
    direction: ltr;
    text-align: left;
    font: inherit;
    line-height: 1.8;
}

.det-textarea:focus {
    border-color: #3b82f6;
    box-shadow:
        0 0 0 4px #dbeafe;
}

.det-result-hero {
    padding: 34px;
    border-radius: 24px;
    background: var(--det-navy);
    color: #fff;
}

.det-score {
    display: inline-block;
    margin-top: 18px;
    padding: 16px 28px;
    border-radius: 18px;
    background: #fff;
    color: var(--det-navy);
    direction: ltr;
    font-size: 48px;
    font-weight: 900;
}

@media (max-width: 960px) {
    .det-hero-grid,
    .det-two-column {
        grid-template-columns: 1fr;
    }

    .det-grid-4 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .det-grid-3 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .det-container {
        width: min(
            100% - 22px,
            1180px
        );
    }

    .det-hero {
        padding: 50px 0;
    }

    .det-grid-2,
    .det-grid-3,
    .det-grid-4,
    .det-status-grid,
    .det-result-grid {
        grid-template-columns: 1fr;
    }

    .det-test-head-row {
        align-items: stretch;
        flex-direction: column;
    }

    .det-timer,
    .det-button {
        width: 100%;
    }
}
