/* ============================================
   DREAM WIZARD v3 — Premium constructor of dreams
   ============================================ */

.dream-wizard-body {
    background: linear-gradient(180deg, #faf5ff 0%, #ecfeff 60%, #fff 100%);
    min-height: 100vh;
}

.dw-shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

/* HERO */
.dw-page { padding-bottom: 80px; }

.dw-hero {
    padding: 56px 0 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.dw-hero::before {
    content: '';
    position: absolute;
    top: -50px; left: 50%;
    transform: translateX(-50%);
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, rgba(6,182,212,0.06) 35%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}
.dw-hero > * { position: relative; z-index: 1; }

.dw-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(124,58,237,0.1);
    border: 1px solid rgba(124,58,237,0.25);
    color: #7c3aed;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 18px;
}

.dw-hero-title {
    font-size: clamp(1.8rem, 4.4vw, 2.8rem);
    font-weight: 900;
    margin-bottom: 14px;
    line-height: 1.15;
    color: #0f172a;
}
.dw-hero-grad {
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.dw-hero-sub {
    font-size: 1.05rem;
    color: #475569;
    max-width: 720px;
    margin: 0 auto 22px;
    line-height: 1.6;
}
.dw-hero-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    color: #475569;
    font-weight: 500;
    font-size: 0.92rem;
}
.dw-hero-trust span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dw-hero-trust i { color: #7c3aed; }

/* WIZARD CARD */
.dw-wizard-wrap {
    padding: 16px 0 60px;
}

.dw-card {
    background: #fff;
    border-radius: 28px;
    padding: 32px 32px 24px;
    box-shadow: 0 30px 80px rgba(124,58,237,0.12);
    border: 1px solid rgba(124,58,237,0.08);
    position: relative;
}

/* PROGRESS */
.dw-progress { margin-bottom: 24px; }
.dw-progress-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}
.dw-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #06b6d4);
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
    box-shadow: 0 0 14px rgba(124,58,237,0.4);
}
.dw-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 600;
}
.dw-progress-step { color: #7c3aed; }

/* STEPS */
.dw-step {
    display: none;
    animation: dwFadeIn 0.4s ease;
}
.dw-step.active { display: block; }
@keyframes dwFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dw-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ede9fe, #cffafe);
    color: #7c3aed;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.dw-question {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 6px;
    line-height: 1.25;
}
.dw-hint {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0 0 22px;
}

/* GRID PICK */
.dw-grid {
    display: grid;
    gap: 14px;
}
.dw-grid--3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.dw-grid--rooms { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.dw-grid--must { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.dw-grid--lifestyle { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.dw-grid--priority { grid-template-columns: 1fr; gap: 8px; }
.dw-grid--style { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.dw-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 14px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: #0f172a;
    font: inherit;
}
.dw-pick:hover {
    border-color: #c4b5fd;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(124,58,237,0.1);
}
.dw-pick.is-picked,
.dw-pick.active {
    border-color: #7c3aed;
    background: linear-gradient(135deg, #faf5ff, #ecfeff);
    box-shadow: 0 12px 32px rgba(124,58,237,0.18);
}
.dw-pick.is-picked .dw-pick-icon,
.dw-pick.active .dw-pick-icon {
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    color: #fff;
    box-shadow: 0 8px 20px rgba(124,58,237,0.3);
}

.dw-pick-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: #f1f5f9;
    color: #475569;
    transition: all 0.2s;
}
.dw-pick-label {
    font-weight: 700;
    font-size: 0.95rem;
}
.dw-pick-meta {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}
.dw-pick.is-picked .dw-pick-meta {
    color: #7c3aed;
}

.dw-pick--single {
    flex-direction: row;
    justify-content: flex-start;
    padding: 14px 18px;
    text-align: left;
}

/* STYLE CARDS */
.dw-style-card {
    display: block;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 22px;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.25s;
    text-align: left;
    color: #0f172a;
    font: inherit;
}
.dw-style-card:hover {
    transform: translateY(-3px);
    border-color: var(--style-color, #7c3aed);
    box-shadow: 0 18px 40px rgba(124,58,237,0.14);
}
.dw-style-card.is-picked {
    border-color: var(--style-color, #7c3aed);
    box-shadow: 0 18px 40px rgba(124,58,237,0.22);
}
.dw-style-cover {
    height: 110px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--style-color, #7c3aed) 90%, white 0%), color-mix(in srgb, var(--style-color, #7c3aed) 60%, #06b6d4 30%));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.4rem;
}
.dw-style-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 16px 18px 4px;
}
.dw-style-card p {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0 18px 16px;
    line-height: 1.5;
}

/* PALETTE */
.dw-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}
.dw-palette-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s;
    font: inherit;
    text-align: center;
}
.dw-palette-card:hover {
    transform: translateY(-2px);
    border-color: #c4b5fd;
    box-shadow: 0 12px 28px rgba(124,58,237,0.1);
}
.dw-palette-card.is-picked {
    border-color: #7c3aed;
    box-shadow: 0 12px 32px rgba(124,58,237,0.2);
}
.dw-palette-strips {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-radius: 10px;
    overflow: hidden;
    height: 56px;
}
.dw-palette-strips span {
    flex: 1;
}
.dw-palette-label {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.92rem;
}

/* AREA & FIELDS */
.dw-area-row,
.dw-budget-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 26px;
}
@media (max-width: 640px) {
    .dw-area-row, .dw-budget-row { grid-template-columns: 1fr; }
}
.dw-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
}
.dw-field input,
.dw-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.98rem;
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.dw-field input:focus,
.dw-field select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.dw-area-control {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dw-area-control input {
    flex: 1;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 800;
}
.dw-step-btn {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: #faf5ff;
    border: 1.5px solid #e2e8f0;
    color: #7c3aed;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.dw-step-btn:hover {
    background: #ede9fe;
    border-color: #7c3aed;
}

.dw-section-divider {
    margin: 28px 0 18px;
    text-align: center;
    position: relative;
}
.dw-section-divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: 0;
}
.dw-section-divider span {
    position: relative;
    z-index: 1;
    background: #fff;
    padding: 0 18px;
    color: #64748b;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dw-priority-title {
    display: block;
    font-weight: 700;
    color: #475569;
    font-size: 0.85rem;
    margin: 18px 0 8px;
}

.dw-textarea {
    width: 100%;
    padding: 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-size: 0.98rem;
    font-family: inherit;
    color: #0f172a;
    resize: vertical;
    min-height: 120px;
}
.dw-textarea:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

.dw-summary {
    margin-top: 22px;
    padding: 18px;
    background: linear-gradient(135deg, #faf5ff, #ecfeff);
    border-radius: 16px;
    border: 1px solid rgba(124,58,237,0.15);
}

/* NAV */
.dw-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #f1f5f9;
}
.dw-btn-back {
    padding: 12px 20px;
    background: transparent;
    border: 0;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.15s;
}
.dw-btn-back:hover:not(:disabled) {
    color: #7c3aed;
    background: #faf5ff;
}
.dw-btn-back:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.dw-btn-next,
.dw-btn-finish {
    padding: 14px 28px;
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    border: 0;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(124,58,237,0.32);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.dw-btn-next:hover,
.dw-btn-finish:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 16px 40px rgba(124,58,237,0.4);
}

/* RESULT MODAL */
.dw-modal {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
}
.dw-modal.is-open {
    display: flex;
}
.dw-modal-card {
    background: #fff;
    max-width: 720px;
    width: 100%;
    border-radius: 28px;
    padding: 32px 28px;
    position: relative;
    margin: 24px auto;
    box-shadow: 0 40px 100px rgba(0,0,0,0.4);
}
.dw-modal-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 0;
    color: #64748b;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.dw-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.dw-result-hero {
    text-align: center;
    margin-bottom: 24px;
}
.dw-result-icon {
    width: 80px; height: 80px;
    margin: 0 auto 14px;
    border-radius: 24px;
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    box-shadow: 0 20px 40px rgba(124,58,237,0.3);
}
.dw-result-title {
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 6px;
    color: #0f172a;
}
.dw-result-sub {
    color: #64748b;
    margin: 0;
}

/* STATS */
.dw-result-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 140px;
    gap: 14px;
    margin-bottom: 22px;
}
@media (max-width: 640px) {
    .dw-result-stats {
        grid-template-columns: 1fr 1fr;
    }
    .dw-stat--score { grid-column: 1 / -1; }
}
.dw-stat {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}
.dw-stat-label {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-bottom: 6px;
}
.dw-stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}
.dw-stat-sub {
    display: block;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 4px;
}

.dw-stat--score {
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.dw-score-ring {
    position: relative;
    width: 90px; height: 90px;
}
.dw-score-ring svg {
    width: 100%;
    height: 100%;
}
.dw-score-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    color: #7c3aed;
}

/* MOODBOARD */
.dw-result-moodboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}
.dw-mood-tile {
    aspect-ratio: 1;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(15,23,42,0.08);
}
.dw-mood-tile i {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

/* EXTRAS LIST */
.dw-result-extras {
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    display: none;
}
.dw-result-extras.has-items {
    display: block;
}
.dw-result-extras-title {
    font-weight: 700;
    color: #475569;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.dw-extra-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    color: #334155;
    font-size: 0.92rem;
    border-bottom: 1px dashed #e2e8f0;
}
.dw-extra-row:last-child { border-bottom: 0; }
.dw-extra-row strong { color: #7c3aed; font-weight: 800; }

/* CTA */
.dw-result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dw-result-cta {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    border: 0;
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(124,58,237,0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}
.dw-result-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 42px rgba(124,58,237,0.42);
    color: #fff;
}
.dw-result-share {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.dw-result-share:hover {
    border-color: #7c3aed;
    color: #7c3aed;
    background: #faf5ff;
}

/* SHARE PAGE */
.dw-share-page {
    background: linear-gradient(180deg, #faf5ff 0%, #ecfeff 60%, #fff 100%);
    min-height: 100vh;
    padding-bottom: 80px;
}

@media (max-width: 640px) {
    .dw-card {
        padding: 22px 16px 18px;
    }
    .dw-modal-card {
        padding: 24px 18px;
    }
}


/* === Контекстный баннер для авторизованного owner'а === */
.dw-context-banner {
    margin: 24px auto 0;
    max-width: 720px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(124,58,237,0.06));
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
}
.dw-context-banner i {
    color: #10b981;
    font-size: 1.4rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.dw-context-banner strong {
    display: block;
    color: #0f172a;
    font-weight: 800;
    margin-bottom: 4px;
    font-size: 0.95rem;
}
.dw-context-banner span {
    display: block;
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.5;
}
