/* ─────────────────────────────────────────────────────────────────
   WorkDone — стилі сторінки модерації («Допомога з навчанням»).

   Розмітка: resources/views/pages/languageSelect/_moderation.blade.php,
   каркас сторінки — index.blade.php (гілка config('ad.moderation_mode')).

   Файл навмисно не перевикористовує .lp-* з landing.css: у сторінки
   модерації власний набір класів (.wdm-*), щоб HTML-«відбиток» не
   збігався з іншими воронками (див. MULTI_DOMAIN_SETUP.md). Дизайн при
   цьому той самий, тому всі розміри, кольори й брейкпоінти тут
   збігаються зі значеннями landing.css.
   ───────────────────────────────────────────────────────────────── */

:root {
    /* Палітра — та сама фіолетово-індіго гама, що і в landing.css. */
    --wdm-primary: rgb(113, 71, 205);
    --wdm-primary-light: rgb(146, 91, 255);
    --wdm-primary-soft: rgba(113, 71, 205, .35);

    --wdm-bg-from: #667eea;
    --wdm-bg-to: #764ba2;

    --wdm-surface: #ffffff;

    --wdm-text: #1a1230;
    --wdm-text-soft: #5a5a72;
    --wdm-text-muted: #9aa0b3;

    --wdm-border: rgba(113, 71, 205, .14);
    --wdm-border-strong: rgba(113, 71, 205, .28);
    --wdm-tint: rgba(113, 71, 205, .05);
    --wdm-tint-strong: rgba(113, 71, 205, .1);

    --wdm-radius-shell: 28px;
    --wdm-radius-pill: 999px;

    --wdm-shadow-shell: 0 22px 56px rgba(40, 28, 80, .26);
    --wdm-shadow-elev: 0 12px 30px rgba(113, 71, 205, .28);
    --wdm-shadow-soft: 0 6px 18px rgba(113, 71, 205, .14);

    --wdm-grad: linear-gradient(135deg, var(--wdm-primary) 0%, var(--wdm-primary-light) 100%);
}

/* ─── Доступно скрінрідеру, невидимо на екрані ─── */
.wdm-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ─── Сторінка ─── */
.wdm-page {
    display: flex;
    align-items: center;
    padding: 32px 0;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--wdm-bg-from) 0%, var(--wdm-bg-to) 100%);
    color: var(--wdm-text);
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* На телефоне 100vh включает скрытую адресную строку. */
@supports (min-height: 100dvh) {
    .wdm-page { min-height: 100dvh; }
}

/* Декоративні плями на фоні — суто косметика, тому псевдоелементи. */
.wdm-page::before,
.wdm-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 255, .08) 0%, transparent 70%);
    animation: wdmDrift 22s ease-in-out infinite;
}
.wdm-page::before { top: -45%; right: -15%; width: 760px; height: 760px; }
.wdm-page::after {
    bottom: -35%; left: -10%; width: 580px; height: 580px;
    animation-duration: 17s;
    animation-direction: reverse;
}

@keyframes wdmDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-40px, -40px) scale(1.08); }
}

/* ─── Картка ─── */
.wdm-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    width: calc(100% - 40px);
    max-width: 560px;
    margin: 0 auto;
    padding: 44px 36px 40px;
    background: var(--wdm-surface);
    border-radius: var(--wdm-radius-shell);
    box-shadow: var(--wdm-shadow-shell);
}

/* ─── Шапка картки ─── */
.wdm-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.wdm-brand {
    display: inline-block;
    height: 50px;
    max-width: 70px;
}
.wdm-brand img { max-width: 100%; height: auto; }

.wdm-title {
    margin: 22px auto 0;
    max-width: 480px;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -.5px;
    text-align: center;
    color: var(--wdm-text);
}
.wdm-subtitle {
    margin: 12px auto 0;
    max-width: 440px;
    font-size: 15.5px;
    line-height: 1.55;
    text-align: center;
    color: var(--wdm-text-soft);
}

/* ─── Показники довіри ─── */
.wdm-metrics {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 560px;
    margin: 24px 0 0;
    padding: 16px 10px;
    background: var(--wdm-tint);
    border: 1px solid var(--wdm-border);
    border-radius: 18px;
}
.wdm-metric {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 0 10px;
    min-width: 0;
}
.wdm-metric-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.4px;
    color: var(--wdm-primary);
}
.wdm-metric-name {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    color: var(--wdm-text-soft);
}
/* Вертикальна риска між показниками. */
.wdm-metric + .wdm-metric::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px; height: 34px;
    background: var(--wdm-border-strong);
}

/* ─── Кроки ─── */
.wdm-guide {
    width: 100%;
    max-width: 560px;
    margin-top: 24px;
}
.wdm-guide-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .1px;
    text-align: center;
    color: var(--wdm-text);
}
.wdm-guide-list {
    counter-reset: wdm-step;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.wdm-guide-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    background: var(--wdm-surface);
    border: 1px solid var(--wdm-border);
    border-radius: 14px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--wdm-text);
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.wdm-guide-item:hover {
    border-color: var(--wdm-border-strong);
    box-shadow: var(--wdm-shadow-soft);
    transform: translateY(-1px);
}
/* Номер кроку малює лічильник — у розмітці жодних цифр. */
.wdm-guide-item::before {
    counter-increment: wdm-step;
    content: counter(wdm-step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    flex-shrink: 0;
    background: var(--wdm-grad);
    border-radius: 50%;
    box-shadow: var(--wdm-shadow-soft);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}
/* Стрілка між кроками сидить у проміжку грід-колонок (30px). */
.wdm-guide-item + .wdm-guide-item::after {
    content: '→';
    position: absolute;
    top: 50%;
    right: calc(100% + 15px);
    transform: translate(50%, -50%);
    font-size: 16px;
    line-height: 1;
    color: var(--wdm-primary-soft);
}

/* ─── Форма ─── */
.wdm-request {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin-top: 24px;
}
.wdm-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: opacity .4s, transform .4s, visibility 0s linear .4s;
}
/* visibility прибирає поля і з таб-порядку, і з a11y-дерева —
   самого opacity: 0 для цього мало. */
.wdm-request.is-sent .wdm-form {
    opacity: 0;
    transform: scale(.95);
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    inset: 0;
}

/* Підказка для випадку, коли JS вимкнено: форму нікуди не відправити. */
.wdm-noscript {
    margin: 12px 0 0;
    padding: 10px 14px;
    background: var(--wdm-tint);
    border: 1px solid var(--wdm-border);
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    text-align: center;
    color: var(--wdm-text-soft);
}

.wdm-alert {
    margin: 0;
    padding: 10px 14px;
    background: rgba(220, 38, 38, .08);
    border: 1px solid rgba(220, 38, 38, .2);
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.4;
    text-align: center;
    color: #b91c1c;
}
.wdm-alert[hidden] { display: none; }

.wdm-control {
    position: relative;
    display: flex;
    align-items: center;
}
.wdm-control--wide { align-items: flex-start; }
.wdm-control-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    z-index: 1;
    pointer-events: none;
    color: var(--wdm-text-muted);
    transition: color .2s;
}
.wdm-control--wide .wdm-control-icon { top: 18px; transform: none; }

.wdm-control-input,
.wdm-control-area {
    width: 100%;
    background: var(--wdm-surface);
    border: 1.5px solid var(--wdm-border);
    outline: none;
    font-family: inherit;
    font-size: 15px;
    color: var(--wdm-text);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.wdm-control-input { padding: 14px 18px 14px 46px; border-radius: var(--wdm-radius-pill); }

/* iOS Safari зумит страницу при фокусе на поле с font-size < 16px:
   на тач-устройствах поднимаем и базовые 15px, и мобильные 14px. */
@media (hover: none) and (pointer: coarse), (max-width: 900px) {
    .wdm-control-input,
    .wdm-control-area { font-size: 16px; }
}
.wdm-control-area {
    padding: 14px 18px 14px 46px;
    border-radius: 18px;
    resize: vertical;
    min-height: 96px;
}

.wdm-control-input::placeholder,
.wdm-control-area::placeholder { color: var(--wdm-text-muted); }

.wdm-control-input:hover,
.wdm-control-area:hover { border-color: var(--wdm-border-strong); }

.wdm-control-input:focus,
.wdm-control-area:focus {
    border-color: var(--wdm-primary);
    box-shadow: 0 0 0 4px rgba(113, 71, 205, .14);
}
.wdm-control:focus-within .wdm-control-icon { color: var(--wdm-primary); }

/* ─── Кнопка надсилання ─── */
.wdm-send {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    padding: 17px 38px;
    overflow: hidden;
    background: var(--wdm-grad);
    border: none;
    border-radius: var(--wdm-radius-pill);
    box-shadow: var(--wdm-shadow-elev);
    font-family: inherit;
    font-size: 16.5px;
    font-weight: 700;
    letter-spacing: -.1px;
    color: #fff;
    cursor: pointer;
    transition: transform .25s, box-shadow .25s;
}
.wdm-send::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .22) 50%, transparent 100%);
    transform: translateX(-100%);
}
.wdm-send:hover::after { animation: wdmShine .8s ease; }
.wdm-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(113, 71, 205, .42);
}
.wdm-send:active { transform: translateY(0) scale(.98); }
.wdm-send:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.wdm-send-arrow { flex-shrink: 0; transition: transform .3s; }
.wdm-send:hover .wdm-send-arrow { transform: translateX(4px); }

@keyframes wdmShine { to { transform: translateX(100%); } }

/* ─── Екран успіху ─── */
.wdm-done {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    text-align: center;
    animation: wdmFadeUp .5s ease;
}
.wdm-request.is-sent .wdm-done { display: flex; }
.wdm-done:focus { outline: none; }
@keyframes wdmFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.wdm-done-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px; height: 64px;
    margin-bottom: 16px;
    background: var(--wdm-grad);
    border-radius: 50%;
    box-shadow: var(--wdm-shadow-elev);
    font-size: 30px;
    color: #fff;
}
.wdm-done-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--wdm-primary);
}
.wdm-done-text {
    margin: 0;
    max-width: 340px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--wdm-text-soft);
}

/* ─── Переваги ─── */
.wdm-claims {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}
.wdm-claim {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--wdm-tint);
    border: 1px solid var(--wdm-border);
    border-radius: var(--wdm-radius-pill);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--wdm-text);
    transition: background .2s, border-color .2s, transform .2s;
}
.wdm-claim:hover {
    background: var(--wdm-tint-strong);
    border-color: var(--wdm-border-strong);
    transform: translateY(-1px);
}
.wdm-claim-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    flex-shrink: 0;
    color: var(--wdm-primary);
}

/* ── Адаптив ── */
@media (max-width: 1190px) {
    .wdm-shell { padding: 38px 28px; }
    .wdm-title { font-size: 28px; }
}

@media (max-width: 760px) {
    .wdm-page::before { width: 500px; height: 500px; }
    .wdm-page::after  { width: 400px; height: 400px; }
    .wdm-shell { padding: 32px 22px 30px; border-radius: 24px; }
    .wdm-title { font-size: 24px; line-height: 1.22; }
    .wdm-subtitle { font-size: 14.5px; }
    .wdm-metrics { padding: 16px 8px; }
    .wdm-metric-value { font-size: 22px; }
    .wdm-metric-name { font-size: 11px; }
    .wdm-guide-item { padding: 10px 12px; font-size: 12px; }
    .wdm-claims { gap: 14px; margin-top: 24px; }
}

@media (max-width: 480px) {
    .wdm-page { padding: 18px 0; }
    .wdm-page::before { width: 320px; height: 320px; top: -28%; right: -30%; }
    .wdm-page::after  { width: 260px; height: 260px; bottom: -18%; left: -22%; }
    .wdm-shell {
        padding: 26px 16px 26px;
        border-radius: 22px;
        box-shadow: 0 16px 40px rgba(40, 28, 80, .26);
    }
    .wdm-brand { height: 42px; max-width: 56px; }
    .wdm-title { font-size: 22px; margin-top: 16px; }
    .wdm-subtitle { font-size: 14px; margin-top: 10px; }
    .wdm-metrics { flex-direction: column; gap: 12px; padding: 16px 12px; }
    .wdm-metric + .wdm-metric::before {
        left: 50%;
        top: auto;
        bottom: calc(100% + 6px);
        transform: translate(-50%, 50%);
        width: 60px; height: 1px;
    }
    .wdm-metric-value { font-size: 22px; }
    .wdm-guide-list { grid-template-columns: 1fr; gap: 24px; }
    .wdm-guide-item { padding: 10px 14px; }
    .wdm-guide-item + .wdm-guide-item::after {
        top: auto;
        right: auto;
        left: 50%;
        bottom: calc(100% + 12px);
        transform: translate(-50%, 50%) rotate(90deg);
    }
    .wdm-request { margin-top: 22px; }
    /* 16px, а не 14px: иначе iOS Safari зумит страницу при фокусе на поле. */
    .wdm-control-input { padding: 13px 16px 13px 42px; font-size: 16px; }
    .wdm-control-area  { padding: 13px 16px 13px 42px; font-size: 16px; }
    .wdm-control-icon { left: 14px; width: 16px; height: 16px; }
    .wdm-control-icon svg { width: 16px; height: 16px; }
    .wdm-send { padding: 15px 28px; font-size: 15px; }
    .wdm-claims { flex-direction: column; gap: 8px; margin-top: 20px; }
    .wdm-claim { justify-content: center; padding: 6px 12px; }
    .wdm-done-icon { width: 52px; height: 52px; font-size: 24px; }
    .wdm-done-title { font-size: 19px; }
    .wdm-done-text { font-size: 14px; }
}
