@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* =============================================
   DESIGN TOKENS
   ============================================= */
:root {
    --bg: #060912;
    --bg-surface: #0d1117;
    --bg-card: rgba(13, 17, 28, 0.7);
    --bg-card-hover: rgba(20, 26, 44, 0.85);
    --bg-input: rgba(6, 9, 18, 0.6);

    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dim: rgba(99, 102, 241, 0.12);
    --accent-glow: rgba(99, 102, 241, 0.35);
    --accent-border: rgba(99, 102, 241, 0.45);

    --violet: #8b5cf6;
    --violet-dim: rgba(139, 92, 246, 0.12);
    --violet-glow: rgba(139, 92, 246, 0.3);

    --cyan: #22d3ee;
    --cyan-dim: rgba(34, 211, 238, 0.08);

    --success: #10b981;
    --success-dim: rgba(16, 185, 129, 0.12);
    --success-glow: rgba(16, 185, 129, 0.3);

    --danger: #ef4444;
    --warning: #f59e0b;

    --text-primary: #f1f5f9;
    --text-secondary: #8892a4;
    --text-muted: #4b5563;

    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    --border-accent: var(--accent-border);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);

    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 24px 16px;
}

/* =============================================
   ANIMATED BACKGROUND
   ============================================= */
.background-elements {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.background-elements::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 10% 100%, rgba(99, 102, 241, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 90% 0%, rgba(139, 92, 246, 0.07) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(34, 211, 238, 0.03) 0%, transparent 60%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    will-change: transform;
}

.orb-1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, #6366f1, #4f46e5);
    top: -200px;
    right: -200px;
    animation: orb-drift 30s ease-in-out infinite alternate;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #22d3ee, #0ea5e9);
    bottom: -150px;
    left: -150px;
    animation: orb-drift 25s ease-in-out infinite alternate-reverse;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #8b5cf6, #7c3aed);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orb-pulse 15s ease-in-out infinite;
    opacity: 0.12;
}

/* Noise texture overlay */
.background-elements::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.4;
}

@keyframes orb-drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-40px, 40px) scale(1.08); }
}

@keyframes orb-pulse {
    0%, 100% { opacity: 0.08; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.15; transform: translate(-50%, -50%) scale(1.2); }
}

/* =============================================
   LAYOUT
   ============================================= */
.wizard-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 980px;
    background: var(--bg-card);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 52px 56px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 32px 64px -16px rgba(0,0,0,0.6),
        0 0 0 1px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    gap: 44px;
    margin: 0 auto;
    animation: container-in 0.7s var(--ease-spring) both;
}

@keyframes container-in {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =============================================
   HEADER
   ============================================= */
.wizard-header {
    text-align: center;
    position: relative;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    color: var(--accent-light);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 20px;
    animation: badge-in 0.6s var(--ease-spring) 0.2s both;
}

.header-badge i {
    font-size: 14px;
}

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

.logo {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.1;
    background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: title-in 0.7s var(--ease-spring) 0.3s both;
}

.logo span {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--violet) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes title-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-top: 12px;
    font-weight: 400;
    line-height: 1.6;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    animation: subtitle-in 0.7s var(--ease-spring) 0.4s both;
}

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

.header-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
    animation: subtitle-in 0.7s var(--ease-spring) 0.5s both;
}

/* =============================================
   STEPPER
   ============================================= */
.stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 20px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
    color: var(--text-muted);
    transition: color 0.4s var(--ease-smooth);
}

.step-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    border: 2px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.4s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.step-circle::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.4s var(--ease-bounce);
}

.step-label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.4s var(--ease-smooth);
}

.step.active {
    color: var(--text-primary);
}

.step.active .step-circle {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 6px var(--accent-dim), 0 0 24px var(--accent-glow);
    color: var(--accent-light);
}

.step.active .step-label {
    color: var(--accent-light);
}

.step.completed {
    color: var(--text-secondary);
}

.step.completed .step-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}

.step.completed .step-circle::after {
    transform: scale(1.8);
    opacity: 0;
}

.step-line {
    flex: 1;
    height: 2px;
    margin: 0 -16px;
    position: relative;
    top: -16px;
    z-index: 1;
    background: var(--border-strong);
    overflow: hidden;
}

.step-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--violet));
    transition: width 0.6s var(--ease-smooth);
    box-shadow: 0 0 8px var(--accent-glow);
}

.step.completed + .step-line::after {
    width: 100%;
}

/* =============================================
   PANELS
   ============================================= */
.step-panel {
    display: none;
}

.step-panel.active {
    display: block;
    animation: panel-in 0.5s var(--ease-spring) both;
}

.step-panel.center-content.active {
    display: flex;
}

@keyframes panel-in {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

.step-panel h2 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.panel-desc {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 1rem;
    line-height: 1.6;
}

/* =============================================
   ROLES GRID
   ============================================= */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.role-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s var(--ease-smooth);
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.role-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-dim), var(--violet-dim));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.role-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-5px);
    box-shadow: 0 12px 28px -8px rgba(0,0,0,0.5), 0 0 0 1px var(--accent-border);
}

.role-card:hover::before {
    opacity: 1;
}

.role-card.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow:
        0 0 0 1px var(--accent),
        0 12px 32px -8px var(--accent-glow),
        0 0 20px -5px var(--accent-glow);
    transform: translateY(-3px);
}

.role-card.selected::before {
    opacity: 1;
}

.role-icon {
    font-size: 2rem;
    color: var(--text-secondary);
    transition: all 0.3s var(--ease-smooth);
    position: relative;
    z-index: 1;
}

.role-card:hover .role-icon,
.role-card.selected .role-icon {
    color: var(--accent-light);
    transform: scale(1.15);
}

.role-card span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    letter-spacing: 0.01em;
}

/* =============================================
   PURPOSES
   ============================================= */
.purposes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.purpose-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.25s var(--ease-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.purpose-item::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border-strong);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.purpose-item:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
    transform: translateX(4px);
    background: var(--accent-dim);
}

.purpose-item:hover::before {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.purpose-item.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent-light);
    box-shadow: 0 0 0 1px var(--accent-border) inset;
    transform: translateX(4px);
}

.purpose-item.selected::before {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* =============================================
   CUSTOM PURPOSE INPUT
   ============================================= */
.custom-purpose {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255,255,255,0.015);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-strong);
    transition: border-color 0.3s ease;
}

.custom-purpose:focus-within {
    border-color: var(--accent-border);
    border-style: solid;
}

.custom-purpose label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-dim);
    background: rgba(6,9,18,0.9);
}

/* =============================================
   CONFIG GRID (Step 3)
   ============================================= */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
}

.config-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-section h3::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 16px;
    background: linear-gradient(to bottom, var(--accent), var(--violet));
    border-radius: 2px;
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-card {
    display: flex;
    position: relative;
    cursor: pointer;
}

.option-card input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.card-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.25s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.card-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--accent), var(--violet));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    border-radius: 0 2px 2px 0;
}

.option-card:hover .card-content {
    border-color: var(--border-accent);
    background: var(--accent-dim);
    transform: translateX(3px);
}

.option-card input:checked ~ .card-content {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 1px var(--accent-border) inset;
    transform: translateX(3px);
}

.option-card input:checked ~ .card-content::before {
    transform: scaleX(1);
}

.card-content .value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    font-variant-numeric: tabular-nums;
}

.option-card input:checked ~ .card-content .value {
    color: var(--accent-light);
}

.card-content .desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.option-card:hover .card-content .desc,
.option-card input:checked ~ .card-content .desc {
    color: var(--text-secondary);
}

/* Radio indicator */
.card-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    flex-shrink: 0;
    transition: all 0.3s var(--ease-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    transform: scale(0);
    transition: transform 0.3s var(--ease-bounce);
}

.option-card input:checked ~ .card-content .card-radio {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.option-card input:checked ~ .card-content .card-radio::after {
    transform: scale(1);
}

/* =============================================
   STEP 4 – SUMMARY
   ============================================= */
.center-content {
    justify-content: center;
    align-items: center;
    min-height: 340px;
}

.flex-column {
    flex-direction: column;
    gap: 24px;
}

.summary-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 100%;
    max-width: 520px;
    text-align: center;
}

.summary-card h2 {
    font-size: 1.4rem;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.summary-list {
    list-style: none;
    text-align: left;
    margin: 24px 0;
    padding: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.summary-list li {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    background: rgba(255,255,255,0.015);
    transition: background 0.2s;
}

.summary-list li:last-child {
    border-bottom: none;
}

.summary-list li:hover {
    background: rgba(255,255,255,0.03);
}

.summary-list li span {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-list li strong {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    max-width: 60%;
}

.generator-status {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 80px;
    justify-content: center;
}

.generator-status p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* =============================================
   INSPIRATIONS SECTION
   ============================================= */
.inspirations-section {
    width: 100%;
    max-width: 620px;
    background: linear-gradient(135deg, rgba(139,92,246,0.06), rgba(99,102,241,0.04));
    border: 1px solid rgba(139,92,246,0.22);
    border-radius: var(--radius-lg);
    padding: 28px;
    animation: panel-in 0.6s var(--ease-spring) both;
}

.inspirations-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(139,92,246,0.15);
}

.inspirations-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--violet-dim);
    border: 1px solid rgba(139,92,246,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #a78bfa;
    flex-shrink: 0;
}

.inspirations-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #ede9fe;
    margin-bottom: 4px;
}

.inspirations-header p {
    font-size: 0.85rem;
    color: #a78bfa;
    line-height: 1.5;
}

/* =============================================
   PROMPT CARDS
   ============================================= */
.prompts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prompt-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    position: relative;
    transition: all 0.25s var(--ease-smooth);
    cursor: default;
}

.prompt-card:hover {
    border-color: rgba(139,92,246,0.35);
    background: rgba(139,92,246,0.04);
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.prompt-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.prompt-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #cbd5e1;
    font-family: var(--font-mono);
    flex-grow: 1;
}

.prompt-effect {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s var(--ease-smooth);
    transform: translateY(-4px);
    line-height: 1.5;
}

.prompt-card:hover .prompt-effect {
    opacity: 1;
    max-height: 80px;
    margin-top: 10px;
    transform: translateY(0);
}

/* Copy button */
.btn-copy {
    background: rgba(139,92,246,0.1);
    border: 1px solid rgba(139,92,246,0.25);
    color: #c4b5fd;
    border-radius: 8px;
    padding: 7px 12px;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
    font-family: inherit;
}

.btn-copy:hover {
    background: rgba(139,92,246,0.25);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--violet-glow);
}

.btn-copy.copied {
    background: var(--success-dim);
    border-color: var(--success);
    color: var(--success);
}

/* =============================================
   FOOTER & NAVIGATION BUTTONS
   ============================================= */
.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 28px;
    gap: 12px;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    padding: 13px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s var(--ease-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    letter-spacing: 0.01em;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: inherit;
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97) !important; }

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none;
}

/* Primary */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--violet));
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 8px 28px var(--accent-glow);
    transform: translateY(-2px);
}

/* Secondary */
.btn-secondary {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--border-accent);
    color: var(--text-primary);
    background: var(--accent-dim);
}

/* Success */
.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
    box-shadow: 0 4px 16px var(--success-glow);
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 8px 28px var(--success-glow);
    transform: translateY(-2px);
}

/* Outline */
.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-border);
    color: var(--accent-light);
}

.btn-outline:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-ghost:hover {
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

/* =============================================
   LOADING & SPINNER
   ============================================= */
.loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ph-spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    display: flex;
    animation: modal-in 0.35s var(--ease-spring) forwards;
}

@keyframes modal-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    background: #0d1117;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 640px;
    height: 85vh;
    max-height: 820px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    animation: modal-content-in 0.4s var(--ease-spring) 0.05s both;
}

@keyframes modal-content-in {
    from { transform: scale(0.95) translateY(20px); }
    to   { transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.02);
    flex-shrink: 0;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--violet-dim);
    border: 1px solid rgba(139,92,246,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    font-size: 1.1rem;
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.modal-header-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.btn-close {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-close:hover {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.3);
    color: var(--danger);
}

.modal-search {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-search input {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.modal-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 5px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent-border);
}

.modal-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 16px;
    line-height: 1.5;
    padding: 10px 14px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Category tags */
.prompt-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-light);
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    padding: 3px 9px;
    border-radius: 100px;
    margin-bottom: 6px;
}

/* =============================================
   RESTART WRAPPER
   ============================================= */
.restart-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

/* =============================================
   TOAST NOTIFICATION
   ============================================= */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a2035;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transition: transform 0.4s var(--ease-spring), opacity 0.3s ease;
    opacity: 0;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.1rem;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }

/* =============================================
   PROGRESS BAR (generating)
   ============================================= */
@keyframes progress-bar {
    from { background-position: 0 0; }
    to { background-position: 40px 0; }
}

.generating-bar {
    width: 200px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--violet), var(--accent));
    background-size: 200%;
    animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
    from { background-position: 0% center; }
    to { background-position: 200% center; }
}

/* =============================================
   UTILITY
   ============================================= */
.orb-3 { display: none; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .wizard-container {
        border-radius: 0;
        border: none;
        padding: 28px 20px;
        min-height: 100svh;
        gap: 32px;
        box-shadow: none;
    }

    .stepper {
        padding: 0;
    }

    .step-label {
        display: none;
    }

    .step-circle {
        width: 42px;
        height: 42px;
        font-size: 0.9rem;
    }

    .config-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .roles-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .purposes-list {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .step-panel h2 {
        font-size: 1.35rem;
    }

    .wizard-footer {
        flex-wrap: wrap;
    }

    .btn {
        flex: 1;
        justify-content: center;
    }

    .summary-card {
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    .purposes-list {
        grid-template-columns: 1fr;
    }

    .roles-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .logo {
        font-size: 2rem;
    }
}
