/*
 * DeepLaw Ekhtebar shared experience layer v1.0.0
 * Presentation and accessibility only; no product or workflow logic.
 */

:root {
    --ek-motion-fast: 150ms;
    --ek-motion-base: 240ms;
    --ek-motion-slow: 520ms;
    --ek-ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
    --ek-ease-emphasized: cubic-bezier(0.16, 1, 0.3, 1);
    --ek-focus: #c49343;
    --ek-success: #187553;
    --ek-info: #315f7a;
    --ek-elevated-shadow:
        0 24px 70px rgba(23, 62, 50, 0.12),
        0 4px 14px rgba(25, 33, 29, 0.06);
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(
            circle at 82% 8%,
            rgba(178, 138, 74, 0.07),
            transparent 28rem
        ),
        var(--ek-bg);
}

button,
a,
input,
textarea,
select,
[tabindex] {
    -webkit-tap-highlight-color: transparent;
}

:where(
    button,
    a,
    input,
    textarea,
    select,
    [tabindex]:not([tabindex="-1"])
):focus-visible {
    outline: 3px solid var(--ek-focus);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(196, 147, 67, 0.2);
}

.ek-skip-link {
    position: fixed;
    z-index: 10000;
    top: 12px;
    right: 16px;
    padding: 11px 16px;
    color: #fff;
    background: var(--ek-primary);
    border-radius: 12px;
    box-shadow: var(--ek-elevated-shadow);
    font-weight: 800;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform var(--ek-motion-fast) ease;
}

.ek-skip-link:focus {
    transform: translateY(0);
}

.ek-topbar {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.ek-brand__mark {
    position: relative;
    overflow: hidden;
    box-shadow: 0 9px 22px rgba(23, 62, 50, 0.22);
}

.ek-brand__mark::after {
    content: "";
    position: absolute;
    inset: -80% 50% -80% -50%;
    background: linear-gradient(
        100deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: translateX(140%) rotate(12deg);
    animation: ek-brand-sheen 7s ease-in-out 1.2s infinite;
}

.ek-sidebar__profile {
    box-shadow: 0 10px 28px rgba(25, 33, 29, 0.05);
}

.ek-nav__item {
    position: relative;
    overflow: hidden;
    transition:
        color var(--ek-motion-fast) ease,
        background-color var(--ek-motion-fast) ease,
        transform var(--ek-motion-fast) ease;
}

.ek-nav__item::before {
    content: "";
    position: absolute;
    top: 13px;
    right: 0;
    bottom: 13px;
    width: 3px;
    background: var(--ek-accent);
    border-radius: 999px;
    opacity: 0;
    transform: scaleY(0.35);
    transition:
        opacity var(--ek-motion-fast) ease,
        transform var(--ek-motion-base) var(--ek-ease-standard);
}

.ek-nav__item:hover {
    transform: translateX(-2px);
}

.ek-nav__item.is-active::before,
.ek-nav__item[aria-current="page"]::before {
    opacity: 1;
    transform: scaleY(1);
}

.ek-nav__item.is-active > span,
.ek-nav__item[aria-current="page"] > span {
    color: var(--ek-primary);
    font-weight: 900;
}

.ek-main {
    isolation: isolate;
}

.ek-panel.ek-is-entering {
    animation: ek-panel-enter var(--ek-motion-base) var(--ek-ease-standard) both;
}

.ek-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.ek-hero::before,
.ek-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}

.ek-hero::before {
    width: 350px;
    height: 350px;
    top: -250px;
    right: 32%;
    border: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow:
        0 0 0 48px rgba(255, 255, 255, 0.025),
        0 0 0 96px rgba(255, 255, 255, 0.018);
}

.ek-hero::after {
    width: 150px;
    height: 150px;
    left: -40px;
    bottom: -85px;
    background: rgba(178, 138, 74, 0.13);
    filter: blur(2px);
}

.ek-hero > div:first-child,
.ek-readiness-card {
    animation: ek-rise var(--ek-motion-slow) var(--ek-ease-emphasized) both;
}

.ek-readiness-card {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    animation-delay: 80ms;
    transition:
        transform var(--ek-motion-base) var(--ek-ease-standard),
        background-color var(--ek-motion-base) ease;
}

.ek-readiness-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.ek-readiness-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--ek-accent),
        transparent
    );
    transform: scaleX(var(--ek-readiness-scale, 0));
    transform-origin: right;
    transition: transform 900ms var(--ek-ease-standard);
}

#ekhtebarTodayReadiness {
    font-variant-numeric: tabular-nums;
}

.ek-experience-brief {
    position: relative;
    margin-top: 20px;
    padding: 19px 20px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    background:
        linear-gradient(110deg, rgba(255, 255, 255, 0.98), rgba(249, 247, 242, 0.96));
    border: 1px solid rgba(178, 138, 74, 0.28);
    border-radius: var(--ek-radius-md);
    box-shadow: 0 14px 40px rgba(25, 33, 29, 0.07);
    animation: ek-rise var(--ek-motion-slow) var(--ek-ease-emphasized) 120ms both;
}

.ek-experience-brief::after {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    left: -80px;
    bottom: -100px;
    background: rgba(178, 138, 74, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.ek-experience-brief__mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: var(--ek-primary-soft);
    border-radius: 16px;
}

.ek-experience-brief__mark span {
    position: relative;
    width: 18px;
    height: 18px;
    display: block;
    border: 2px solid var(--ek-primary);
    border-radius: 50%;
}

.ek-experience-brief__mark span::before,
.ek-experience-brief__mark span::after {
    content: "";
    position: absolute;
    background: var(--ek-accent);
    border-radius: 999px;
}

.ek-experience-brief__mark span::before {
    width: 2px;
    height: 8px;
    top: 3px;
    left: 6px;
    transform: rotate(45deg);
}

.ek-experience-brief__mark span::after {
    width: 6px;
    height: 2px;
    top: 9px;
    left: 6px;
    transform: rotate(45deg);
}

.ek-experience-brief__eyebrow {
    color: var(--ek-accent);
    font-size: 0.78rem;
    font-weight: 900;
}

.ek-experience-brief h2 {
    margin: 3px 0 2px;
    font-size: clamp(1rem, 2vw, 1.18rem);
}

.ek-experience-brief p {
    margin: 0;
    color: var(--ek-muted);
    font-size: 0.9rem;
    line-height: 1.8;
}

.ek-experience-brief__action {
    position: relative;
    z-index: 1;
    min-height: 46px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #fff;
    background: var(--ek-primary);
    border: 1px solid var(--ek-primary);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(23, 62, 50, 0.17);
    cursor: pointer;
    font-weight: 800;
    white-space: nowrap;
    transition:
        transform var(--ek-motion-fast) ease,
        box-shadow var(--ek-motion-fast) ease,
        background-color var(--ek-motion-fast) ease;
}

.ek-experience-brief__action:hover {
    background: #205143;
    box-shadow: 0 14px 30px rgba(23, 62, 50, 0.22);
    transform: translateY(-2px);
}

.ek-experience-brief__action span {
    transition: transform var(--ek-motion-fast) ease;
}

.ek-experience-brief__action:hover span {
    transform: translateX(-3px);
}

.ek-grid--three > .ek-card {
    animation: ek-rise var(--ek-motion-slow) var(--ek-ease-emphasized) both;
}

.ek-grid--three > .ek-card:nth-child(2) {
    animation-delay: 70ms;
}

.ek-grid--three > .ek-card:nth-child(3) {
    animation-delay: 140ms;
}

.ek-card,
.ek-section,
.ek-empty-state,
.ek-progress__summary > article,
.ek-learning__summary > article {
    transition:
        transform var(--ek-motion-base) var(--ek-ease-standard),
        box-shadow var(--ek-motion-base) ease,
        border-color var(--ek-motion-fast) ease;
}

.ek-card:hover,
.ek-progress__summary > article:hover,
.ek-learning__summary > article:hover {
    border-color: rgba(178, 138, 74, 0.48);
    box-shadow: var(--ek-elevated-shadow);
    transform: translateY(-4px);
}

.ek-card__index {
    transition:
        color var(--ek-motion-fast) ease,
        background-color var(--ek-motion-fast) ease,
        transform var(--ek-motion-base) var(--ek-ease-standard);
}

.ek-card:hover .ek-card__index {
    color: #fff;
    background: var(--ek-primary);
    transform: rotate(-4deg) scale(1.04);
}

:where(
    .ek-diagnostic__primary,
    .ek-progress__refresh,
    .ek-learning__refresh,
    .ek-learning__actions button,
    .ek-oral__primary,
    .ek-oral__submit,
    .ek-oral__evaluate,
    .ek-written__button,
    .ek-academic-action
) {
    transition:
        transform var(--ek-motion-fast) ease,
        box-shadow var(--ek-motion-fast) ease,
        opacity var(--ek-motion-fast) ease,
        background-color var(--ek-motion-fast) ease,
        border-color var(--ek-motion-fast) ease;
}

:where(
    .ek-diagnostic__primary,
    .ek-progress__refresh,
    .ek-learning__refresh,
    .ek-learning__actions button,
    .ek-oral__primary,
    .ek-oral__submit,
    .ek-oral__evaluate,
    .ek-written__button,
    .ek-academic-action
):not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(23, 62, 50, 0.16);
}

button:active:not(:disabled) {
    transform: translateY(0) scale(0.985);
}

button:disabled,
[aria-disabled="true"] {
    cursor: not-allowed;
}

.ek-activity-bar {
    position: fixed;
    z-index: 9998;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ek-motion-fast) ease;
}

.ek-activity-bar span {
    width: 38%;
    height: 100%;
    display: block;
    background: linear-gradient(
        90deg,
        transparent,
        var(--ek-accent) 35%,
        #dfbd79 65%,
        transparent
    );
    transform: translateX(280%);
}

.ek-activity-bar.is-active {
    opacity: 1;
}

.ek-activity-bar.is-active span {
    animation: ek-activity 1.15s ease-in-out infinite;
}

.ek-app.is-ek-busy button[disabled] {
    opacity: 0.72;
}

.ek-toast-region {
    position: fixed;
    z-index: 9999;
    top: 94px;
    left: 22px;
    width: min(390px, calc(100vw - 32px));
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.ek-toast {
    position: relative;
    padding: 15px 15px 15px 44px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    overflow: hidden;
    color: var(--ek-text);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--ek-border);
    border-right: 4px solid var(--ek-info);
    border-radius: 17px;
    box-shadow: var(--ek-elevated-shadow);
    backdrop-filter: blur(16px);
    pointer-events: auto;
    animation: ek-toast-in var(--ek-motion-base) var(--ek-ease-standard) both;
}

.ek-toast.is-leaving {
    animation: ek-toast-out var(--ek-motion-fast) ease both;
}

.ek-toast--success {
    border-right-color: var(--ek-success);
}

.ek-toast--error {
    border-right-color: var(--ek-danger);
}

.ek-toast--info {
    border-right-color: var(--ek-info);
}

.ek-toast__icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--ek-info);
    border-radius: 11px;
    font-size: 0.9rem;
    font-weight: 900;
}

.ek-toast--success .ek-toast__icon {
    background: var(--ek-success);
}

.ek-toast--error .ek-toast__icon {
    background: var(--ek-danger);
}

.ek-toast__copy strong,
.ek-toast__copy span {
    display: block;
}

.ek-toast__copy strong {
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.ek-toast__copy span {
    color: var(--ek-muted);
    font-size: 0.84rem;
    line-height: 1.75;
}

.ek-toast__close {
    position: absolute;
    top: 9px;
    left: 9px;
    width: 29px;
    height: 29px;
    padding: 0;
    display: grid;
    place-items: center;
    color: var(--ek-muted);
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 1.1rem;
}

.ek-toast__close:hover {
    color: var(--ek-text);
    background: var(--ek-surface-soft);
}

.ek-toast::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: currentColor;
    opacity: 0.18;
    transform-origin: right;
    animation: ek-toast-life var(--ek-toast-life, 5600ms) linear both;
}

.ek-milestone {
    position: fixed;
    z-index: 9997;
    top: 50%;
    left: 50%;
    width: min(330px, calc(100vw - 40px));
    padding: 28px 24px;
    display: grid;
    justify-items: center;
    text-align: center;
    color: #fff;
    background: rgba(23, 62, 50, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    box-shadow: 0 34px 100px rgba(23, 62, 50, 0.32);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -46%) scale(0.92);
}

/* DEEPLAW_MILESTONE_HIDDEN_CONTRACT_20260903
 * Preserve the component layout while guaranteeing native hidden semantics.
 */
.ek-milestone[hidden] {
    display: none !important;
}


.ek-milestone.is-visible {
    animation: ek-milestone-in 460ms var(--ek-ease-emphasized) both;
}

.ek-milestone.is-leaving {
    animation: ek-milestone-out 250ms ease both;
}

.ek-milestone__halo {
    position: absolute;
    top: 21px;
    width: 70px;
    height: 70px;
    border: 1px solid rgba(223, 189, 121, 0.5);
    border-radius: 50%;
    animation: ek-halo 1.6s ease-out infinite;
}

.ek-milestone__seal {
    position: relative;
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    display: grid;
    place-items: center;
    color: var(--ek-primary);
    background: #dfbd79;
    border: 5px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background-clip: padding-box;
    font-size: 1.45rem;
    font-weight: 900;
}

.ek-milestone strong {
    margin-bottom: 5px;
    font-size: 1.08rem;
}

.ek-milestone > span {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.88rem;
    line-height: 1.8;
}

.ek-milestone__particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #dfbd79;
    border-radius: 50%;
    opacity: 0;
    animation: ek-particle 900ms var(--ek-ease-standard) var(--ek-delay, 0ms) both;
}

.ek-skeleton {
    position: relative;
    min-height: 16px;
    overflow: hidden;
    background: #e9e6de;
    border-radius: 8px;
    color: transparent !important;
    user-select: none;
}

.ek-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        transparent 18%,
        rgba(255, 255, 255, 0.72) 50%,
        transparent 82%
    );
    transform: translateX(100%);
    animation: ek-skeleton 1.35s ease-in-out infinite;
}

@keyframes ek-brand-sheen {
    0%, 70%, 100% { transform: translateX(140%) rotate(12deg); }
    84% { transform: translateX(-220%) rotate(12deg); }
}

@keyframes ek-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ek-panel-enter {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ek-activity {
    from { transform: translateX(280%); }
    to { transform: translateX(-280%); }
}

@keyframes ek-toast-in {
    from { opacity: 0; transform: translateX(-22px) scale(0.98); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes ek-toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-16px); }
}

@keyframes ek-toast-life {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@keyframes ek-milestone-in {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.92); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes ek-milestone-out {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    to { opacity: 0; transform: translate(-50%, -53%) scale(0.98); }
}

@keyframes ek-halo {
    from { opacity: 0.7; transform: scale(0.7); }
    to { opacity: 0; transform: scale(1.7); }
}

@keyframes ek-particle {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
    22% { opacity: 1; }
    100% {
        opacity: 0;
        transform:
            translate(
                calc(-50% + var(--ek-x)),
                calc(-50% + var(--ek-y))
            )
            scale(0.5);
    }
}

@keyframes ek-skeleton {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

@media (max-width: 980px) {
    .ek-mobile-nav {
        grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
        gap: 3px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
    }

    .ek-mobile-nav::-webkit-scrollbar {
        display: none;
    }

    .ek-mobile-nav button {
        min-width: 0;
        cursor: pointer;
        transition:
            color var(--ek-motion-fast) ease,
            background-color var(--ek-motion-fast) ease,
            transform var(--ek-motion-fast) ease;
    }

    .ek-mobile-nav button[aria-current="page"] {
        color: #fff;
        background: var(--ek-primary);
    }

    .ek-toast-region {
        top: 84px;
    }
}

@media (max-width: 720px) {
    .ek-experience-brief {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .ek-experience-brief__action {
        grid-column: 1 / -1;
        width: 100%;
    }

    .ek-toast-region {
        right: 16px;
        left: 16px;
        width: auto;
    }
}

@media (max-width: 420px) {
    .ek-mobile-nav {
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
        left: 8px;
        padding: 6px;
    }

    .ek-mobile-nav button {
        padding-inline: 3px;
        font-size: 0.72rem;
    }

    .ek-experience-brief {
        padding: 16px;
    }

    .ek-experience-brief__mark {
        width: 42px;
        height: 42px;
    }
}

@media (hover: none) {
    .ek-card:hover,
    .ek-progress__summary > article:hover,
    .ek-learning__summary > article:hover,
    .ek-readiness-card:hover,
    .ek-nav__item:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }

    .ek-milestone__particle,
    .ek-milestone__halo {
        display: none;
    }
}

@media (forced-colors: active) {
    .ek-toast,
    .ek-experience-brief,
    .ek-milestone {
        border: 2px solid CanvasText;
    }

    .ek-nav__item::before,
    .ek-readiness-card::after {
        background: Highlight;
    }
}
