@import url("https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap");

.practice-page {
    --practice-ink: #0d1726;
    --practice-ink-soft: #223247;
    --practice-accent: #ff7a45;
    --practice-accent-strong: #e96534;
    --practice-sun: #f4c06a;
    --practice-surface: #ffffff;
    --practice-surface-alt: #f3f5f7;
    --practice-border: rgba(15, 23, 42, 0.12);
    --practice-shadow: 0 18px 45px rgba(8, 20, 35, 0.15);
    background:
        radial-gradient(circle at 12% 12%, rgba(255, 196, 112, 0.25), transparent 45%),
        radial-gradient(circle at 85% 8%, rgba(80, 162, 192, 0.28), transparent 40%),
        #eef1f5;
    min-height: var(--app-dvh);
    padding-bottom: 4rem;
    color: var(--practice-ink);
    font-family: "Rubik", "Segoe UI", sans-serif;
}

.practice-page h1,
.practice-page h2,
.practice-page h3,
.practice-page h4 {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.practice-hero {
    position: relative;
    overflow: hidden;
    padding: 4.5rem 0 3.25rem;
    color: #f7f9fc;
    background: linear-gradient(125deg, #0b1a2d 0%, #12334f 45%, #1b4b5a 100%);
}

.practice-hero::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -20%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(255, 200, 120, 0.35), transparent 70%);
    pointer-events: none;
}

.practice-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.05), transparent 55%);
    opacity: 0.8;
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.5rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.practice-hero .hero-content {
    max-width: 520px;
}

.practice-hero .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0.6rem;
}

.exam-mode-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.exam-mode-btn {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.exam-mode-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.exam-mode-btn.active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.practice-hero h1 {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    margin-bottom: 0.75rem;
}

.practice-hero .subhead {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 0;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.5rem;
}

.hero-tags span {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.hero-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.hero-tile {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 0.95rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(6px);
    animation: rise 0.8s ease both;
}

.hero-tile--wide {
    grid-column: span 2;
    flex-direction: column;
    align-items: flex-start;
}

.hero-tile:nth-child(2) {
    animation-delay: 0.05s;
}

.hero-tile:nth-child(3) {
    animation-delay: 0.1s;
}

.hero-tile:nth-child(4) {
    animation-delay: 0.15s;
}

.hero-tile:nth-child(5) {
    animation-delay: 0.2s;
}

.hero-tile:nth-child(6) {
    animation-delay: 0.25s;
}

.tile-title {
    font-weight: 600;
}

.tile-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.4rem;
}

.hero-tile i {
    font-size: 1.2rem;
    color: var(--practice-sun);
}

.practice-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
    margin-top: -2.5rem;
    margin-bottom: 2.75rem;
    position: relative;
    z-index: 2;
}

.action-card {
    background: var(--practice-surface);
    border-radius: 24px;
    padding: 1.75rem;
    border: 1px solid var(--practice-border);
    box-shadow: var(--practice-shadow);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: relative;
    overflow: hidden;
    animation: rise 0.85s ease both;
}

.action-card--build::before {
    content: "";
    position: absolute;
    top: -40%;
    left: -20%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255, 200, 120, 0.25), transparent 70%);
    opacity: 0.6;
    pointer-events: none;
}

.action-card--random {
    background: linear-gradient(135deg, #132032, #223a52);
    color: #f9fafb;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.action-card--random p {
    color: rgba(255, 255, 255, 0.75);
}

.action-card--random .action-kicker {
    color: rgba(255, 255, 255, 0.65);
}

.action-card:nth-child(2) {
    animation-delay: 0.1s;
}

.action-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.action-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(13, 27, 45, 0.08);
    color: var(--practice-ink);
    display: grid;
    place-items: center;
    font-size: 1.6rem;
}

.action-card--random .action-icon {
    background: rgba(255, 255, 255, 0.12);
    color: var(--practice-sun);
}

.action-kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: #637187;
    font-weight: 600;
}

.action-content h3 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
}

.action-content p {
    margin: 0;
    color: #5b6777;
}

.action-footer {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.practice-page .action-btn {
    border-radius: 999px;
    padding: 0.65rem 1.6rem;
    font-weight: 600;
    border: none;
    width: fit-content;
}

.practice-page .action-btn--primary {
    background: var(--practice-ink);
    color: #ffffff;
}

.practice-page .action-btn--primary:hover {
    background: #0a1220;
    color: #ffffff;
}

.practice-page .action-btn--accent {
    background: var(--practice-accent);
    color: #24130b;
}

.practice-page .action-btn--accent:hover {
    background: var(--practice-accent-strong);
    color: #24130b;
}

.practice-page .action-btn:disabled {
    background: #9aa4b2;
    color: #eef2f6;
}

.action-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.practice-list {
    padding-top: 1.5rem;
}

.loading-state,
.empty-state {
    background: var(--practice-surface);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border: 1px solid var(--practice-border);
    box-shadow: var(--practice-shadow);
}

.empty-state {
    flex-direction: column;
    text-align: center;
    color: #4b5563;
}

.empty-state i {
    font-size: 2.5rem;
}

.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.test-card {
    background: var(--practice-surface);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--practice-shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid var(--practice-border);
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.test-header h4 {
    margin: 0;
    font-size: 1.2rem;
}

.test-description {
    color: #5b6777;
    margin: 0;
}

.test-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #4b5563;
}

.test-meta i {
    margin-right: 0.35rem;
}

.test-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.test-actions .btn {
    flex: 1 1 110px;
}

.bundle-card {
    margin: 2rem auto 0;
    background: var(--practice-surface);
    border-radius: 22px;
    padding: 2rem;
    border: 1px solid var(--practice-border);
    box-shadow: var(--practice-shadow);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 980px;
}

.bundle-header h3 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
}

.bundle-header p {
    margin: 0;
    color: #5b6777;
}

.bundle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
}

.bundle-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bundle-item label {
    font-weight: 600;
    color: #1f2937;
    letter-spacing: 0.02em;
}

.bundle-item .form-select {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid #d5dce6;
    background: #f8fafc;
}

.bundle-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.bundle-actions .btn {
    min-width: 180px;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
}

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

@media (max-width: 768px) {
    .practice-hero {
        padding: 3.5rem 0 2.75rem;
    }

    .hero-grid {
        gap: 2rem;
    }

    .hero-tiles {
        grid-template-columns: 1fr;
    }

    .hero-tile--wide {
        grid-column: span 1;
    }

    .practice-actions {
        margin-top: -1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-tile,
    .action-card {
        animation: none;
    }
}

.practice-page {
    min-width: 0;
    container-type: inline-size;
}

.practice-page > *,
.practice-page .container,
.practice-hero,
.hero-grid,
.hero-tiles,
.practice-actions,
.action-card,
.action-top,
.test-grid,
.test-card,
.test-header,
.test-meta,
.bundle-card,
.bundle-grid,
.bundle-actions {
    min-width: 0;
}

.hero-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.practice-actions,
.test-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.bundle-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

@container (max-width: 960px) {
    .action-top,
    .test-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (min-width: 1024px) {
    .practice-page .container {
        max-width: min(100%, var(--content-shell-wide-max));
    }

    .practice-hero {
        padding: calc(var(--section-gap) * 2 + 16px) 0 calc(var(--section-gap) + 24px);
    }

    .hero-grid {
        gap: calc(var(--section-gap) + 4px);
    }

    .practice-actions {
        gap: calc(var(--section-gap) - 2px);
        margin-top: calc((var(--section-gap) + 12px) * -1);
        margin-bottom: calc(var(--section-gap) + 20px);
    }

    .action-card {
        padding: max(16px, calc(var(--card-padding) - 4px));
        gap: max(14px, calc(var(--section-gap) - 8px));
    }
}
