/* Wordmorrow global stylesheet: the only application stylesheet (no component CSS, STD-STYLE).
   Every --omni-* variable used here is declared by OmniEurope.Blazor. Mobile first: the base rules target
   phones, the 40rem breakpoint widens. */

html, body {
    margin: 0;
    height: 100%;
}

#app {
    height: 100%;
}

.wm-theme-scope {
    height: 100%;
}

.wm-shell {
    height: 100%;
}

.wm-page {
    /* Full width up to the cap: auto margins in the column flex of the main area would otherwise size
       the page to its content, and a fixed-width child (the 25rem login card) would overflow a phone. */
    width: 100%;
    padding: 1rem;
    max-width: 64rem;
    margin: 0 auto;
    box-sizing: border-box;
    min-width: 0;
}

.wm-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.wm-header-end {
    margin-inline-start: auto;
}

@media (max-width: 30rem) {
    .wm-header-label {
        display: none;
    }
}

.wm-field-error {
    display: block;
    margin-top: 0.25rem;
}

/* Boot screen shown until WebAssembly starts. */
.wm-boot {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.wm-boot__logo {
    animation: wm-float 1.6s ease-in-out infinite;
}

@keyframes wm-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-0.5rem); }
}

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

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    padding: 0.75rem 1rem;
    z-index: 1000;
    background: var(--omni-color-danger);
    color: var(--omni-color-on-danger);
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    margin-inline-start: 1rem;
    color: inherit;
    cursor: pointer;
}

/* Public home (PLAN-002 lot 0). The brand gradient is the one of icon.svg. Cards carry no border: the user wants
   no rim on this page, the surfaces stand out by their fill alone. */
.wm-landing {
    --wm-brand-start: #e30a17;
    --wm-brand-end: #ff6b4a;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    padding: 1rem 0 0;
}

.wm-landing {
    --omni-card-border-color: transparent;
}

.wm-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
}

.wm-hero__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.wm-hero .wm-hero__title {
    margin: 0;
    font-size: clamp(2.1rem, 6vw, 3.25rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.wm-hero__highlight {
    background: linear-gradient(90deg, var(--wm-brand-start), var(--wm-brand-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.wm-hero__lead,
.wm-landing__sub {
    max-width: 34rem;
    margin: 0;
    font-size: var(--omni-font-size-lg);
    color: var(--omni-color-text-muted);
}

.wm-landing__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.wm-landing__cta--center {
    justify-content: center;
}

.wm-hero__assurances {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--omni-font-size-sm);
    color: var(--omni-color-text-muted);
}

.wm-hero__assurances li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.wm-hero__assurances .omni-icon {
    color: var(--omni-color-success);
}

/* Demo learning card: an inert illustration, so it never takes the focus. */
.wm-hero__demo {
    position: relative;
}

.wm-demo-card {
    box-shadow: var(--omni-shadow-md);
}

.wm-demo-card--back {
    display: none;
}

.wm-demo-word {
    font-size: 2rem;
}

.wm-demo-speaker {
    color: var(--omni-color-accent);
}

.wm-demo-muted {
    color: var(--omni-color-text-muted);
}

.wm-demo-sentence {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.25rem;
    background: var(--omni-color-surface-hover);
}

.wm-demo-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.wm-demo-choice {
    padding: 0.5rem;
    border-radius: 0.25rem;
    text-align: center;
    background: var(--omni-color-surface-hover);
}

.wm-demo-choice--right {
    box-shadow: inset 0 0 0 2px var(--omni-color-success);
}

/* Sections */
.wm-landing__section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.wm-landing__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.wm-landing__head .omni-heading,
.wm-landing__final .omni-heading {
    margin: 0;
}

.wm-landing__kicker {
    font-size: var(--omni-font-size-sm);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wm-brand-end);
}

.wm-landing__features {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.wm-feature {
    transition: transform 0.15s ease;
}

.wm-feature:hover {
    transform: translateY(-2px);
}

.wm-feature .omni-heading {
    margin: 0;
}

.wm-feature__icon {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--omni-color-accent) 16%, transparent);
    color: var(--omni-color-accent);
}

.wm-steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: wm-step;
}

.wm-step {
    position: relative;
    padding-top: 3.25rem;
}

.wm-step::before {
    counter-increment: wm-step;
    content: counter(wm-step);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--wm-brand-start), var(--wm-brand-end));
}

.wm-step .omni-heading {
    margin: 0 0 0.35rem;
}

.wm-landing__final {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 1.5rem;
    border-radius: 1rem;
    text-align: center;
    background: radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--omni-color-accent) 22%, transparent), var(--omni-color-surface) 60%);
}

.wm-landing__footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0 1rem;
}

.wm-landing__footer .wm-legal-links {
    margin-top: 0;
}

.wm-landing__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

@media (min-width: 40rem) {
    .wm-landing__features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .wm-landing__footer {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (min-width: 56rem) {
    .wm-hero {
        grid-template-columns: 1.1fr 0.9fr;
        min-height: 26rem;
    }

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

    .wm-demo-card--front {
        position: relative;
        z-index: 1;
        transform: rotate(-1.5deg);
    }

    .wm-demo-card--back {
        display: block;
        position: absolute;
        inset: 11rem -1rem auto 3rem;
        transform: rotate(3deg);
        opacity: 0.7;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wm-feature {
        transition: none;
    }
}

.wm-legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin-top: 1.5rem;
    font-size: var(--omni-font-size-sm);
}

.wm-legal {
    overflow-wrap: anywhere;
}

/* Learning: cards, exercises, feedback. */
.wm-step-card {
    margin-top: 1rem;
}

.wm-card-head {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wm-word-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wm-word {
    font-size: var(--omni-font-size-h2);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.wm-translation {
    font-size: var(--omni-font-size-lg);
}

/* The word of a card is the focus of the screen: larger, with room around it (fluid, fits 375px). */
.wm-card-head {
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.wm-card-head .wm-word {
    font-size: clamp(2.25rem, 9vw, 3.75rem);
    line-height: 1.15;
}

.wm-card-head .wm-translation {
    font-size: var(--omni-font-size-h4, 1.5rem);
}

/* A danger action that stays quiet next to the learning content. */
.omni-button.wm-btn-danger-quiet {
    color: var(--omni-color-danger);
}

.wm-pronunciation {
    font-style: italic;
}

.wm-sentence {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-wrap: anywhere;
}

.wm-sentence--exercise {
    display: block;
    font-size: var(--omni-font-size-lg);
    line-height: 1.8;
}

.wm-gap {
    /* The sentence keeps its own spaces: no margin, or punctuation after the gap drifts away. */
    display: inline-block;
    min-width: 3rem;
    letter-spacing: 0.15em;
    color: var(--omni-color-accent);
}

.wm-target {
    color: var(--omni-color-accent);
}

.wm-keyboard {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.wm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.wm-actions--start {
    justify-content: flex-start;
}

.wm-choices {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
}

.wm-choice {
    min-height: 2.75rem;
}

.wm-exercise-head {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wm-session-progress {
    margin: 0.5rem 0;
}

.wm-stat-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

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

.wm-dash-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
    align-items: start;
}

.wm-tile-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    text-align: center;
}

.wm-activity-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
}

.wm-result-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wm-result-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--omni-color-border);
}

.wm-result-row:last-child {
    border-bottom: none;
}

.wm-result-word {
    font-weight: 600;
}

.wm-result-translation {
    flex: 1 1 8rem;
    color: var(--omni-color-text-muted);
}

@media (min-width: 40rem) {
    .wm-choices,
    .wm-activity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .wm-stat-row--4,
    .wm-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Dictionary and lists. */
.wm-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
}

/* CEFR levels of the new words: one column per band (A, B, C), the two levels of a band stacked. */
.wm-levels {
    grid-auto-flow: column;
    grid-template-columns: repeat(3, max-content);
    grid-template-rows: auto auto;
    column-gap: 2rem;
}

.wm-levels > :not(label) {
    grid-column: 1 / -1;
}

.wm-entry-row {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
    box-sizing: border-box;
    min-height: 2.75rem;
    padding: 0 0.25rem;
    color: inherit;
    text-decoration: none;
}

/* OmniDataList has no density of its own (OE need reported, PLAN-002): its items keep a card padding meant for rich
   items. A dictionary line is one word, so the list is tightened here until OE offers a compact list. */
.wm-compact-list.omni-data-list {
    gap: 0;
}

.wm-compact-list .omni-data-list__item {
    padding: 0.125rem 0.5rem;
}

.wm-entry-row > .wm-result-word {
    flex: 0 0 auto;
}

.wm-entry-row:hover,
.wm-entry-row:focus-visible {
    background: var(--omni-color-surface-hover);
}

.wm-entry-row > .wm-result-translation {
    /* Shrinks and wraps before the state badge has to go to a second line. */
    flex: 1 1 0;
    min-width: 0;
}

.wm-entry-row > .omni-badge {
    /* The state sits at the end of the line, so a word takes one line on a phone. */
    margin-inline-start: auto;
}

.wm-create-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
}

.wm-create-form > :first-child {
    flex: 1 1 14rem;
    max-width: 24rem;
}

.wm-list-entry {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wm-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
}

.wm-history-row {
    font-size: var(--omni-font-size-sm);
}

@media (min-width: 40rem) {
    .wm-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Statistics. */
.wm-badges {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
}

.wm-badge-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wm-badge-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* A tile label may wrap instead of being cut with an ellipsis. */
.wm-stat-row .omni-stat-tile__label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.wm-theme-progress {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--omni-color-border);
}

@media (min-width: 40rem) {
    .wm-badges {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Back office */
.wm-badges-inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--omni-space-2, 0.5rem);
}

.wm-issue-list {
    margin: 0;
    padding-inline-start: 1.25rem;
    display: grid;
    gap: 0.25rem;
    overflow-wrap: anywhere;
}
