/* =============================================================================
   Register V2 — Base Layout
   ============================================================================= */

.regv2 {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-4) var(--space-4) var(--space-6);
    background:
        radial-gradient(circle at 20% 15%, var(--emerald-alpha-8), transparent 42%),
        radial-gradient(circle at 82% 0%, var(--emerald-alpha-5), transparent 32%),
        var(--color-bg-primary);
    color: var(--color-text-primary);
    overflow-x: hidden;
    overflow-y: visible;
}


.regv2::before,
.regv2::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: var(--radius-full);
}

.regv2::before {
    width: 36rem;
    height: 36rem;
    top: -14rem;
    right: -10rem;
    background: radial-gradient(circle, var(--emerald-alpha-12), transparent 70%);
    filter: blur(var(--glass-blur));
}

.regv2::after {
    width: 30rem;
    height: 30rem;
    bottom: -12rem;
    left: -10rem;
    background: radial-gradient(circle, var(--emerald-alpha-10), transparent 72%);
    filter: blur(var(--glass-blur));
}

/* -----------------------------------------------------------------------------
   Journey hero
   ----------------------------------------------------------------------------- */

.regv2-journey-hero {
    --regv2-hero-accent: var(--emerald-500);
    --regv2-hero-accent-soft: var(--emerald-alpha-12);
    --regv2-hero-accent-border: var(--emerald-alpha-20);
    --regv2-hero-wash: var(--emerald-alpha-10);
    position: relative;
    z-index: 60;
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(var(--space-4), 2.6vw, var(--space-5));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    background:
        radial-gradient(circle at top right, var(--regv2-hero-wash), transparent 34%),
        linear-gradient(180deg, var(--glass-bg-card), var(--overlay-white-4));
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--shadow-sm), var(--glow-accent-subtle), inset 0 1px 0 var(--overlay-white-8);
    overflow: visible;
    transition: box-shadow 0.4s var(--ease-smooth), border-color 0.4s var(--ease-smooth);
}

.regv2-journey-hero::before {
    content: "";
    position: absolute;
    top: -7rem;
    right: -5rem;
    width: 14rem;
    height: 14rem;
    border-radius: var(--radius-full);
    background: radial-gradient(circle, var(--regv2-hero-accent-soft), transparent 70%);
    filter: blur(var(--glass-blur));
    pointer-events: none;
    opacity: 0.45;
}

:root[data-theme="light"] .regv2-journey-hero::before {
    opacity: 0.35;
}

/* Hero käyttää YHTÄ accent-väriä (emerald) kaikissa stepeissä.
   Step-erot näkyvät progress-railin tilatasolla (complete/active/upcoming),
   ei väri-paletissa. Tämä noudattaa STYLEGUIDE-periaatetta yhdestä
   accentista per visuaalinen taso. */

.regv2-journey-hero__utility {
    position: relative;
    z-index: 8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    min-height: 40px;
    margin: 0 0 var(--space-5);
}

.regv2-journey-hero__utility-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    min-width: 0;
}

.regv2-journey-hero__intro {
    position: relative;
    z-index: 2;
    margin-bottom: var(--space-5);
}

.regv2-journey-hero__intro-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
}

.regv2-journey-hero__icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--emerald-alpha-20);
    background: var(--emerald-alpha-10);
    color: var(--emerald-500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-base);
    box-shadow: inset 0 1px 0 var(--overlay-white-8);
    flex-shrink: 0;
}

:root[data-theme="light"] .regv2-journey-hero__icon {
    border-color: var(--emerald-alpha-25, var(--emerald-alpha-20));
    background: var(--emerald-alpha-8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.regv2-journey-hero__copy {
    min-width: 0;
}

.regv2-journey-hero__title {
    margin: 0 0 var(--space-1);
    font-family: var(--font-family-display);
    font-size: clamp(var(--font-size-xl), 2.6vw, var(--font-size-2xl));
    font-weight: var(--font-weight-display);
    line-height: var(--leading-heading);
    letter-spacing: var(--tracking-tighter);
    color: var(--color-text-primary);
    text-wrap: balance;
}

.regv2-journey-hero__subtitle {
    margin: 0;
    max-width: 50ch;
    color: var(--color-text-secondary);
    font-size: var(--font-size-body);
    line-height: var(--leading-body);
    text-wrap: pretty;
}

.regv2-journey-hero__title,
.regv2-journey-hero__subtitle {
    transition: opacity 180ms var(--ease-smooth);
}

.regv2-journey-hero__title--fading,
.regv2-journey-hero__subtitle--fading {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .regv2-journey-hero__title,
    .regv2-journey-hero__subtitle {
        transition: none;
    }
}

.regv2-header__logo {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

/* Logo — dark/light variants */
.regv2-header__logo-img {
    height: 26px;
    width: auto;
}

.regv2-header__logo-img--light { display: none; }
.regv2-header__logo-img--dark { display: block; }

:root[data-theme="light"] .regv2-header__logo-img--light { display: block; }
:root[data-theme="light"] .regv2-header__logo-img--dark { display: none; }

.regv2-theme-control {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 2px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    background: linear-gradient(180deg, var(--glass-bg-card), var(--overlay-white-4));
    box-shadow: var(--shadow-sm);
    transition: border-color 0.18s var(--ease-smooth),
                background 0.18s var(--ease-smooth),
                box-shadow 0.18s var(--ease-smooth);
}

.regv2-theme-control:hover {
    border-color: var(--glass-border-hover);
    background: linear-gradient(180deg, var(--glass-bg), var(--overlay-white-6));
    box-shadow: var(--shadow-md);
}

/* Theme switch — CSS grid + calculated thumb alignment ----------------------
   Outer: 74 × 40px, border 1px → inner: 72 × 38px
   Grid: 1fr 1fr → each cell 36px wide
   Cell centers: 18px and 54px from inner left
   Thumb: 32px circle → left: 2px (dark) / 38px (light)
   --------------------------------------------------------------------------- */
.regv2-theme-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 78px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    transition: background 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth);
}

.regv2-theme-switch:hover {
    background: var(--overlay-white-4);
}

.regv2-theme-switch:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring-shadow);
}

/* Each icon sits in its own grid cell, perfectly centered */
.regv2-theme-switch__icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    line-height: 1;
    color: var(--color-text-secondary);
    transition: color 0.2s var(--ease-smooth);
}

/* Thumb: neutral glass knob, active theme indicated by position and icon color */
.regv2-theme-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 34px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--glass-border-strong);
    background: linear-gradient(180deg, var(--glass-bg-card), var(--glass-bg));
    box-shadow: var(--shadow-sm), inset 0 1px 0 var(--overlay-white-10);
    transition: left 0.25s var(--ease-smooth);
    pointer-events: none;
}

/* Dark mode: moon selected on the right */
:root:not([data-theme="light"]) .regv2-theme-switch__thumb {
    left: 41px;
}

:root:not([data-theme="light"]) .regv2-theme-switch__icon:nth-of-type(2) {
    color: var(--color-text-primary);
}

/* Light mode: sun selected on the left */
:root[data-theme="light"] .regv2-theme-switch__thumb {
    left: 3px;
}

:root[data-theme="light"] .regv2-theme-switch__icon:nth-of-type(1) {
    color: var(--color-text-primary);
}

.regv2-lang {
    position: relative;
    flex-shrink: 0;
    z-index: 20;
}

.regv2-lang__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    gap: var(--space-2);
    border-radius: var(--radius-full);
    border: 1px solid var(--glass-border);
    background: linear-gradient(180deg, var(--glass-bg-card), var(--overlay-white-4));
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1);
    box-shadow: var(--shadow-sm);
    transition: color 0.15s var(--ease-smooth),
                border-color 0.15s var(--ease-smooth),
                background 0.15s var(--ease-smooth),
                box-shadow 0.15s var(--ease-smooth);
}

.regv2-lang__trigger:hover {
    color: var(--color-text-primary);
    border-color: var(--glass-border-hover);
    background: var(--glass-bg);
    box-shadow: var(--shadow-md);
}

.regv2-lang__trigger:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring-shadow);
}

.regv2-lang__btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    background: var(--overlay-white-4);
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.regv2-lang__btn-label {
    display: inline-block;
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.regv2-lang__btn-chevron {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    transition: transform 0.15s var(--ease-smooth), color 0.15s var(--ease-smooth);
}

.regv2-lang.is-open .regv2-lang__btn-chevron {
    transform: rotate(180deg);
    color: var(--color-text-secondary);
}

.regv2-lang__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    max-width: min(280px, calc(100vw - 24px));
    max-height: 320px;
    overflow-y: auto;
    padding: var(--space-2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: var(--glass-bg-solid);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.16s var(--ease-smooth), transform 0.16s var(--ease-smooth);
    z-index: 2000;
    display: grid;
    gap: var(--space-1);
}

.regv2-lang.is-open .regv2-lang__menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.regv2-lang__option {
    width: 100%;
    min-height: 44px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-align: left;
    transition: color 0.15s var(--ease-smooth),
                background 0.15s var(--ease-smooth),
                box-shadow 0.15s var(--ease-smooth);
}

.regv2-lang__option:hover {
    background: var(--glass-bg);
    color: var(--color-text-primary);
}

.regv2-lang__option:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring-shadow);
}

.regv2-lang__option.is-active {
    background: var(--color-accent-muted);
    color: var(--color-text-primary);
    box-shadow: inset 0 0 0 1px var(--glass-border-hover);
}

.regv2-lang__option-label {
    min-width: 0;
}

.regv2-lang__option-check {
    color: var(--color-accent);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.15s var(--ease-smooth), transform 0.15s var(--ease-smooth);
}

.regv2-lang__option.is-active .regv2-lang__option-check {
    opacity: 1;
    transform: scale(1);
}

/* -----------------------------------------------------------------------------
   Journey rail
   ----------------------------------------------------------------------------- */

.regv2-progress {
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0;
}

.regv2-progress__track,
.regv2-progress__fill {
    display: none;
}

.regv2-progress__rail {
    display: grid;
    /* 2 stepiä: Tunnus + Työtila. Trial aktivoituu auto preview-CTA:lla,
       joten Laskutus ei ole oma steppinsä rekisteröinnissä. */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--overlay-white-4), var(--glass-bg));
    box-shadow: inset 0 1px 0 var(--overlay-white-6);
    overflow: hidden;
}

.regv2-progress__item {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-2);
    align-items: center;
    min-height: 64px;
    padding: var(--space-2) var(--space-3);
    color: var(--color-text-muted);
    transition: background 0.2s var(--ease-smooth),
                color 0.2s var(--ease-smooth),
                border-color 0.2s var(--ease-smooth);
}

.regv2-progress__item + .regv2-progress__item {
    border-left: 1px solid var(--glass-border);
}

.regv2-progress__item-badge {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: var(--overlay-white-4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    flex-shrink: 0;
}

.regv2-progress__item-check {
    display: none;
    font-size: var(--font-size-sm);
}

.regv2-progress__item-index {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1;
}

.regv2-progress__item-copy {
    min-width: 0;
}

.regv2-progress__item-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-tight);
    color: inherit;
}

/* Yhtenäinen emerald-paletti — tila erottaa stepit, ei väri.
   Premium-pattern: completed (täysi emerald), active (rajattu+glow),
   upcoming (muted neutral). */

.regv2-progress__item.is-active {
    color: var(--accent-text-emerald);
    background: linear-gradient(180deg, var(--emerald-alpha-5), transparent);
}

.regv2-progress__item.is-complete {
    color: var(--accent-text-emerald);
}

.regv2-progress__item.is-upcoming {
    color: var(--color-text-muted);
    opacity: 0.86;
}

.regv2-progress__item.is-complete .regv2-progress__item-badge {
    background: var(--emerald-500);
    border-color: transparent;
}

.regv2-progress__item.is-complete .regv2-progress__item-check {
    display: inline-block;
    color: var(--brand-blue-700);
}

.regv2-progress__item.is-complete .regv2-progress__item-index {
    display: none;
}

.regv2-progress__item.is-active .regv2-progress__item-badge {
    color: var(--accent-text-emerald);
    background: var(--emerald-alpha-10);
    border-color: var(--emerald-alpha-30, var(--emerald-alpha-25));
    box-shadow: 0 0 0 3px var(--emerald-alpha-10);
}

.regv2-progress__item.is-active .regv2-progress__item-label {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-semibold, 600);
}

.regv2-progress__item.is-complete .regv2-progress__item-label {
    color: var(--color-text-secondary);
}

/* -----------------------------------------------------------------------------
   Content & Steps
   ----------------------------------------------------------------------------- */

.regv2-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.regv2-step {
    width: 100%;
    max-width: 720px;
    display: none;
}

.regv2-step--active {
    display: block;
    animation: regv2StepFadeIn 350ms var(--ease-out-expo) both;
}

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

@media (prefers-reduced-motion: reduce) {
    .regv2-step--active {
        animation: none;
    }
}

/* -----------------------------------------------------------------------------
   Card
   ----------------------------------------------------------------------------- */

.regv2-card {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    background: var(--glass-bg-card);
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--shadow-card), var(--shadow-md), var(--glow-accent-subtle), inset 0 1px 0 var(--overlay-white-8);
    padding: clamp(var(--space-6), 4vw, var(--space-8));
    text-align: left;
}

.regv2-card__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-icon-emerald-border);
    background: var(--glass-icon-emerald);
    color: var(--emerald-500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-inner-soft);
}

.regv2-card__icon i {
    color: inherit;
}

.regv2-card__icon--indigo {
    color: var(--indigo-500);
    border-color: var(--glass-icon-indigo-border);
    background: var(--glass-icon-indigo);
}

.regv2-card__icon--emerald {
    color: var(--emerald-500);
    border-color: var(--glass-icon-emerald-border);
    background: var(--glass-icon-emerald);
}

.regv2-card__icon--purple {
    color: var(--purple-500);
    border-color: var(--glass-icon-purple-border);
    background: var(--glass-icon-purple);
}

.regv2-card__icon--cyan {
    color: var(--cyan-500);
    border-color: var(--glass-icon-cyan-border);
    background: var(--glass-icon-cyan);
}

.regv2-card__icon--teal {
    color: var(--teal-500);
    border-color: var(--glass-icon-teal-border);
    background: var(--glass-icon-teal);
}

.regv2-card__icon--gold {
    color: var(--gold-500);
    border-color: var(--glass-icon-gold-border);
    background: var(--glass-icon-gold);
}

.regv2-card__icon--rose {
    background: var(--glass-icon-rose);
    border-color: var(--glass-icon-rose-border);
    color: var(--rose-500);
}

.regv2-card__title {
    margin: 0 0 var(--space-3);
    font-size: clamp(var(--font-size-2xl), 3vw, var(--font-size-3xl));
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
    text-wrap: balance;
}

.regv2-card__subtitle {
    margin: 0 0 var(--space-6);
    max-width: 60ch;
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-secondary);
    text-wrap: pretty;
}

#registerV2App[data-active-step="F"] .regv2-journey-hero,
#registerV2App[data-active-step="F"] .regv2-content,
#registerV2App[data-active-step="F"] .regv2-step[data-step="F"] {
    max-width: 880px;
}

#registerV2App[data-active-step="A"] .regv2-journey-hero,
#registerV2App[data-active-step="B"] .regv2-journey-hero,
#registerV2App[data-active-step="F"] .regv2-journey-hero {
    margin-bottom: var(--space-4);
}

#registerV2App[data-active-step="A"] .regv2-card,
#registerV2App[data-active-step="B"] .regv2-card,
#registerV2App[data-active-step="F"] .regv2-card {
    padding: clamp(var(--space-5), 3.2vw, var(--space-7));
}

.regv2-card__footer {
    border-top: 1px solid var(--glass-border);
    padding-top: var(--space-4);
    margin-top: var(--space-4);
}

.regv2-placeholder {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    text-align: center;
    padding: var(--space-6);
}

/* -----------------------------------------------------------------------------
   Animation
   ----------------------------------------------------------------------------- */

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

/* -----------------------------------------------------------------------------
   Tablet — 641px to 920px
   Compact stepper (circles only, no labels), 2-col forms
   ----------------------------------------------------------------------------- */

@media (min-width: 641px) and (max-width: 920px) {
    .regv2 {
        padding: var(--space-4) var(--space-3) var(--space-5);
    }

    .regv2-journey-hero {
        padding: var(--space-3);
        border-radius: var(--radius-xl);
    }

    .regv2-journey-hero__utility {
        margin-bottom: var(--space-4);
    }

    .regv2-journey-hero__title {
        font-size: var(--font-size-xl);
    }

    .regv2-journey-hero__subtitle {
        font-size: var(--font-size-sm);
    }

    .regv2-progress__item {
        min-height: 60px;
        padding: var(--space-2) var(--space-3);
    }

    .regv2-progress__item-label {
        font-size: var(--font-size-xs);
    }

    .regv2-card {
        padding: var(--space-6) var(--space-5);
        border-radius: var(--radius-xl);
    }

    .regv2-card__subtitle {
        font-size: var(--font-size-sm);
    }

}

/* -----------------------------------------------------------------------------
   Mobile — <=640px
   Hide full stepper, show mobile counter
   ----------------------------------------------------------------------------- */

@media (max-width: 640px) {
    .regv2 {
        padding: var(--space-3) var(--space-3) var(--space-5);
    }

    .regv2-journey-hero {
        padding: var(--space-3);
        border-radius: var(--radius-xl);
    }

    .regv2-journey-hero__utility {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: var(--space-4);
        gap: var(--space-3);
    }

    .regv2-journey-hero__utility-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .regv2-theme-control {
        order: 2;
    }

    .regv2-lang {
        order: 3;
    }

    .regv2-journey-hero__intro {
        margin-bottom: var(--space-4);
    }

    .regv2-journey-hero__intro-main {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .regv2-journey-hero__icon {
        width: 36px;
        height: 36px;
        border-radius: var(--radius-md);
        font-size: var(--font-size-base);
    }

    .regv2-journey-hero__title {
        font-size: var(--font-size-lg);
    }

    .regv2-journey-hero__subtitle {
        font-size: var(--font-size-xs);
    }

    .regv2-progress__item {
        min-height: 58px;
        padding: var(--space-2) var(--space-3);
    }

    .regv2-progress__rail {
        grid-template-columns: 1fr;
    }

    .regv2-progress__item + .regv2-progress__item {
        border-left: none;
        border-top: 1px solid var(--glass-border);
    }

    .regv2-lang__btn-label {
        max-width: 72px;
    }

    .regv2-card {
        padding: var(--space-5) var(--space-4);
        border-radius: var(--radius-xl);
    }

    .regv2-card__title {
        font-size: var(--font-size-xl);
    }

    .regv2-card__subtitle {
        font-size: var(--font-size-sm);
    }
}

/* -----------------------------------------------------------------------------
   Reduced Motion
   ----------------------------------------------------------------------------- */

/* --- Toast fallback ------------------------------------------------------- */
.regv2-toast {
    position: fixed;
    top: var(--space-6);
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: var(--z-toast);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    opacity: 0;
    transition: opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth);
    pointer-events: none;
}
.regv2-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.regv2-toast--error {
    background: var(--red-500);
    color: var(--white);
}

/* --- Light mode color overrides -------------------------------------------- */

:root[data-theme="light"] .regv2-card__icon {
    box-shadow: var(--shadow-inner-soft), var(--shadow-sm);
}

:root[data-theme="light"] .regv2-card {
    border-color: var(--grey-500);
    background: var(--white);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.06),
        0 4px 16px rgba(0, 0, 0, 0.04),
        0 8px 32px rgba(0, 0, 0, 0.03);
}

:root[data-theme="light"] .regv2-journey-hero {
    border-color: var(--grey-500);
    background:
        radial-gradient(circle at top right, var(--regv2-hero-wash), transparent 34%),
        linear-gradient(180deg, var(--white), var(--grey-300));
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.06),
        0 4px 16px rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .regv2-progress__rail {
    border-color: var(--grey-600);
    background: linear-gradient(180deg, var(--white), var(--grey-300));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .regv2-progress__item + .regv2-progress__item {
    border-left-color: var(--grey-500);
}

:root[data-theme="light"] .regv2-progress__item {
    color: var(--color-text-secondary);
}

:root[data-theme="light"] .regv2-progress__item.is-upcoming {
    opacity: 1;
    color: var(--color-text-secondary);
}

:root[data-theme="light"] .regv2-progress__item.is-active {
    background: linear-gradient(180deg, var(--white), var(--grey-300));
}

/* Light mode: yhtenäinen emerald-600 accent (WCAG-kontrasti).
   Tilatasolla erottaminen säilyy is-active / is-complete / is-upcoming
   -modifiereilla — ei per-step värivariaatiota. */
:root[data-theme="light"] .regv2-progress__item.is-active,
:root[data-theme="light"] .regv2-progress__item.is-complete {
    color: var(--accent-text-emerald);
}

:root[data-theme="light"] .regv2-progress__item.is-upcoming {
    color: var(--color-text-muted);
}

:root[data-theme="light"] .regv2-progress__item-badge {
    border-color: var(--grey-600);
    background: var(--white);
}

:root[data-theme="light"] .regv2-progress__item-index {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-semibold);
}

:root[data-theme="light"] .regv2-progress__item.is-active .regv2-progress__item-badge {
    background: var(--white);
    border-color: currentColor;
    box-shadow: 0 0 0 2px currentColor, 0 0 12px rgba(16, 185, 129, 0.15);
}

:root[data-theme="light"] .regv2-progress__item.is-active .regv2-progress__item-index {
    color: currentColor;
    font-weight: var(--font-weight-semibold);
}

:root[data-theme="light"] .regv2-progress__item-label {
    font-weight: var(--font-weight-medium);
}

:root[data-theme="light"] .regv2-progress__item.is-active .regv2-progress__item-label {
    color: currentColor;
    font-weight: var(--font-weight-semibold);
}

:root[data-theme="light"] .regv2-progress__item.is-complete .regv2-progress__item-badge {
    background: currentColor;
    border-color: currentColor;
}

:root[data-theme="light"] .regv2-progress__item.is-complete .regv2-progress__item-check {
    color: var(--white);
}

:root[data-theme="light"] .regv2-theme-control {
    border-color: var(--grey-500);
    background: linear-gradient(180deg, var(--white), var(--grey-300));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .regv2-lang__trigger {
    border-color: var(--grey-500);
    background: linear-gradient(180deg, var(--white), var(--grey-300));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .regv2-lang__trigger:hover {
    border-color: var(--grey-600);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .regv2-lang__menu {
    border-color: var(--grey-500);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 8px 32px rgba(0, 0, 0, 0.04);
}

/* --- Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .regv2-step,
    .regv2-phase,
    .regv2-progress__fill,
    .regv2-theme-switch,
    .regv2-theme-switch__thumb,
    .regv2-theme-switch__icon,
    .regv2-lang__menu,
    .regv2-toast,
    .regv2-enrich-mode,
    .regv2-source-card,
    .regv2-sources__input-area,
    #ideaModeFields {
        animation: none !important;
        transition: none !important;
    }

}
