/* =============================================================================
   Stakly Setup Wizard — Styles
   ============================================================================= */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --border: #334155;
    --border-focus: #818cf8;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #38bdf8;
    --radius: 0.75rem;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ─── Layout ──────────────────────────────────────────────────────── */

.wizard-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.wizard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.wizard-header h1 {
    font-size: 1.75rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.wizard-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.brand-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
}

/* ─── Progress Bar ────────────────────────────────────────────────── */

.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    cursor: pointer;
    transition: all 0.2s;
}

.step-indicator .circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    color: var(--text-muted);
    transition: all 0.3s;
}

.step-indicator.active .circle {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    box-shadow: 0 0 16px rgba(129, 140, 248, 0.4);
}

.step-indicator.completed .circle {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.step-indicator .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    text-align: center;
    max-width: 80px;
}

.step-indicator.active .label { color: var(--accent); font-weight: 600; }
.step-indicator.completed .label { color: var(--success); }

/* ─── Card ────────────────────────────────────────────────────────── */

.wizard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    animation: fadeIn 0.3s ease;
}

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

.wizard-card h2 {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-card .step-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ─── Forms ───────────────────────────────────────────────────────── */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-group label .required { color: var(--error); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

textarea { min-height: 80px; resize: vertical; }

input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    accent-color: var(--accent);
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */

.btn-row {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}

.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-secondary); color: var(--text-primary); }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #16a34a; }

.btn-danger {
    background: var(--error);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

/* ─── Tags / Chips ────────────────────────────────────────────────── */

.tags-input {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.4rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    min-height: 42px;
    align-items: center;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.8rem;
}

.tag .remove {
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.7;
}

.tag .remove:hover { opacity: 1; }

.tags-input input {
    flex: 1;
    min-width: 120px;
    border: none;
    background: transparent;
    padding: 0.3rem;
}

.tags-input input:focus { box-shadow: none; }

/* ─── Agent Cards ─────────────────────────────────────────────────── */

.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.agent-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.2s;
    position: relative;
}

.agent-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.agent-card .agent-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.agent-card .agent-emoji {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(129, 140, 248, 0.1);
}

.agent-card .agent-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.agent-card .agent-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.agent-card .agent-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.5rem 0;
}

.agent-card .trait {
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
    background: rgba(129, 140, 248, 0.08);
    border-radius: 0.75rem;
    color: var(--text-secondary);
}

.agent-card .agent-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.agent-card .remove-agent {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem;
}

.agent-card .remove-agent:hover { color: var(--error); }

/* ─── Room Cards ──────────────────────────────────────────────────── */

.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.room-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
}

.room-card .room-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.room-card .room-topic {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.room-card .room-members {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ─── Member List ─────────────────────────────────────────────────── */

.member-list {
    margin: 1rem 0;
}

.member-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.member-item .name { font-weight: 500; }
.member-item .role { font-size: 0.85rem; color: var(--text-secondary); }
.member-item .dept { font-size: 0.85rem; color: var(--text-muted); }

/* ─── Summary ─────────────────────────────────────────────────────── */

.summary-section {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.summary-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.summary-section .summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.9rem;
}

.summary-section .summary-item .label { color: var(--text-secondary); }
.summary-section .summary-item .value { font-weight: 500; }

/* ─── Provisioning Log ────────────────────────────────────────────── */

.provision-log {
    margin: 1rem 0;
}

.provision-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.provision-step .status-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.provision-step .status-icon.success { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.provision-step .status-icon.failed { background: rgba(239, 68, 68, 0.2); color: var(--error); }
.provision-step .status-icon.running { background: rgba(129, 140, 248, 0.2); color: var(--accent); }
.provision-step .status-icon.pending { background: rgba(100, 116, 139, 0.2); color: var(--text-muted); }

.provision-step .step-info { flex: 1; }
.provision-step .step-name { font-weight: 500; font-size: 0.9rem; }
.provision-step .step-service { font-size: 0.75rem; color: var(--text-muted); }
.provision-step .step-duration { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Loading ─────────────────────────────────────────────────────── */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--text-secondary);
}

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

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

/* ─── Alert ───────────────────────────────────────────────────────── */

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.alert-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-success { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); color: #86efac; }
.alert-info { background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.3); color: #7dd3fc; }

/* ─── Philosophy Select ───────────────────────────────────────────── */

.philosophy-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.philosophy-option {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.philosophy-option:hover { border-color: var(--accent); }
.philosophy-option.selected { border-color: var(--accent); background: rgba(129, 140, 248, 0.08); }

.philosophy-option .icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.philosophy-option .title { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.25rem; }
.philosophy-option .desc { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .agent-grid { grid-template-columns: 1fr; }
    .philosophy-options { grid-template-columns: 1fr; }
    .member-item { grid-template-columns: 1fr; }
    .step-indicator .label { display: none; }
    .progress-bar::before { display: none; }
    .roi-comparison { grid-template-columns: 1fr; }
    .roi-advantages { grid-template-columns: 1fr 1fr; }
    .roi-table-wrap { font-size: 0.75rem; }
}

/* ─── ROI Simulation ──────────────────────────────────────────────── */

.roi-section { margin-bottom: 1.5rem; }
.roi-section h3 { margin-bottom: 0.75rem; font-size: 1.05rem; color: var(--accent); }

.roi-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.roi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.roi-table th {
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.65rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.roi-table td {
    padding: 0.65rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.roi-table tbody tr:hover { background: rgba(129, 140, 248, 0.04); }

.roi-table .text-right { text-align: right; }
.roi-table .font-bold { font-weight: 600; color: var(--accent); }

/* Comparison columns */
.roi-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.roi-col {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.roi-col h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.roi-human { border-top: 3px solid var(--warning); }
.roi-human h3 { color: var(--warning); }

.roi-ai { border-top: 3px solid var(--success); }
.roi-ai h3 { color: var(--success); }

.roi-line {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.roi-total {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0 0.25rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    border-top: 2px solid var(--border);
    margin-top: 0.25rem;
}

.roi-total-yearly {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Savings banner */
.roi-savings-banner {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.12), rgba(34, 197, 94, 0.12));
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.roi-savings-banner .big-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.35rem;
}

.roi-savings-banner .big-sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.roi-savings-banner .big-sub strong {
    color: var(--success);
}

/* Advantages grid */
.roi-advantages {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.advantage {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.advantage strong { color: var(--text-primary); display: block; margin-bottom: 0.15rem; }
.adv-icon { font-size: 1.25rem; flex-shrink: 0; }

/* Ethical note */
.roi-ethical {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius);
    padding: 1rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.ethical-icon { font-size: 1.5rem; flex-shrink: 0; }

/* ROI mini summary in step 7 */
.roi-summary-mini .highlight {
    background: rgba(129, 140, 248, 0.06);
    border-radius: 6px;
    padding: 0.15rem 0.25rem;
}
.roi-summary-mini .highlight .value {
    color: var(--accent);
    font-weight: 700;
}

/* ─── Mode Selector ───────────────────────────────────────────────── */

.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.mode-option {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.mode-option:hover { border-color: var(--accent); }
.mode-option.selected { border-color: var(--accent); background: rgba(129, 140, 248, 0.08); }

.mode-option .mode-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.mode-option .mode-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.25rem; }
.mode-option .mode-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Advanced Section ────────────────────────────────────────────── */

.advanced-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(129, 140, 248, 0.04);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: var(--radius);
}

.advanced-header {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    color: var(--accent);
}

.advanced-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.badge-advanced {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    padding: 0.15rem 0.6rem;
    border-radius: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ─── Editable Fields ─────────────────────────────────────────────── */

.editable-field[contenteditable="true"] {
    cursor: text;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
    transition: all 0.15s;
    outline: none;
    min-height: 1.2em;
}

.editable-field[contenteditable="true"]:hover {
    background: rgba(129, 140, 248, 0.06);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.15);
}

.editable-field[contenteditable="true"]:focus {
    background: rgba(129, 140, 248, 0.1);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.btn-edit-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.btn-edit-icon:hover { opacity: 1; }

.agent-expand {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.agent-edit-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: inherit;
}

.agent-edit-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

/* Room editable */
.room-card .editable-field.room-name { font-weight: 600; font-size: 0.95rem; }
.room-card .editable-field.room-topic { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.room-visibility { border-bottom: 1px dashed var(--text-muted); }

/* ─── Plan Selector ───────────────────────────────────────────────── */

.plan-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 0.75rem 0;
}

.plan-card {
    position: relative;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.25rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
}

.plan-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.15);
}

.plan-card.selected {
    border-color: var(--accent);
    background: rgba(129, 140, 248, 0.06);
    box-shadow: 0 0 0 1px var(--accent), 0 4px 20px rgba(129, 140, 248, 0.2);
}

.plan-badge {
    position: absolute;
    top: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.85rem;
    border-radius: 1rem;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.plan-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.plan-price {
    margin-bottom: 1rem;
}

.plan-price .price-amount {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
}

.plan-price .price-period {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.plan-feature {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.3rem 0;
    line-height: 1.4;
}

.plan-feature.highlight {
    color: var(--text-primary);
    font-weight: 600;
}

.plan-feature.infra {
    color: var(--accent);
    font-weight: 500;
}

.section-label {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
    .mode-selector { grid-template-columns: 1fr; }
    .plan-selector { grid-template-columns: 1fr; }
}

/* ─── Reset / Quit Button ─────────────────────────────────────────── */

.wizard-header {
    position: relative;
}

.btn-reset-wizard {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    padding: 0.35rem 0.85rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
    opacity: 0.7;
}

.btn-reset-wizard:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: #fca5a5;
    opacity: 1;
}

/* ─── Reset Confirmation Modal ────────────────────────────────────── */

.reset-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.reset-modal-overlay.visible {
    opacity: 1;
}

.reset-modal-box {
    background: var(--bg-card);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(16px);
    transition: transform 0.2s ease;
}

.reset-modal-overlay.visible .reset-modal-box {
    transform: translateY(0);
}

.reset-modal-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.reset-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.reset-modal-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.reset-modal-desc strong {
    color: #fca5a5;
}

.reset-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.reset-modal-actions .btn {
    min-width: 130px;
    justify-content: center;
}

/* ─── Feedback Section (Step 5 — AI Team Regeneration) ───────────── */

.feedback-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(129, 140, 248, 0.04);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: var(--radius);
}

.feedback-section h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.feedback-textarea {
    width: 100%;
    min-height: 70px;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: white;
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-hover), #9333ea);
    box-shadow: 0 0 16px rgba(129, 140, 248, 0.3);
}

.btn-accent:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── Add Agent Panel (Step 5 — Team Integration) ───────────────── */

.add-agent-panel {
    background: rgba(129, 140, 248, 0.04);
    border: 1px dashed rgba(129, 140, 248, 0.35);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 1.25rem 0;
}

.add-agent-panel h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.add-agent-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.add-agent-row .form-group {
    margin-bottom: 0;
}

/* ─── Reorganization Animation (Team Pulse) ──────────────────────── */

@keyframes reorganize-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
}

.agent-card.reorganizing {
    animation: reorganize-pulse 1s ease-in-out infinite;
    border-color: var(--accent) !important;
    pointer-events: none;
}

/* ─── New Agent Glow ────────────────────────────────────────────── */

@keyframes new-agent-glow {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    50% { box-shadow: 0 0 24px 6px rgba(34, 197, 94, 0.25); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.agent-card.agent-new {
    border-color: #22c55e !important;
    animation: new-agent-glow 2s ease-in-out 3;
}

/* ─── Change Badge (Modified Agents) ────────────────────────────── */

.change-badge {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    color: #b45309;
    animation: fadeInUp 0.3s ease;
    z-index: 2;
}

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

/* ─── Reorganization Banner ─────────────────────────────────────── */

.reorg-banner {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.08), rgba(34, 197, 94, 0.06));
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    animation: slideDown 0.4s ease;
}

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

.reorg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.reorg-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.reorg-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-muted);
    padding: 0.2rem;
}

.reorg-close:hover {
    color: var(--text-primary);
}

.reorg-reasoning {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-style: italic;
    line-height: 1.5;
}

.reorg-change {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.35rem 0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(129, 140, 248, 0.1);
}

.reorg-change:last-child {
    border-bottom: none;
}

.reorg-agent {
    font-weight: 600;
    min-width: 100px;
    color: var(--accent);
}

.reorg-summary {
    color: var(--text-secondary);
}

/* ─── Credentials Table (Step 7 — Post-Deploy) ──────────────────── */

.credentials-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: var(--radius);
}

.credentials-section h3 {
    font-size: 1rem;
    color: var(--success);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.credentials-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.credentials-table th {
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.6rem 0.65rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.credentials-table td {
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.credentials-table tbody tr:hover { background: rgba(34, 197, 94, 0.04); }

.credentials-table .pwd {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.82rem;
    background: var(--bg-primary);
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
    letter-spacing: 0.02em;
    user-select: all;
}

.credentials-warning {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ── Login page ──────────────────────────────────────────────────────────── */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    background: var(--card-bg, #1e293b);
    padding: 3rem;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
    font-size: 1.5rem;
    margin: 0.5rem 0;
    color: var(--primary, #818cf8);
}

.login-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-muted, #94a3b8);
    margin: 0.5rem 0 2rem;
    font-size: 0.9rem;
}

.login-card .form-group {
    text-align: left;
    margin-bottom: 1.2rem;
}

.login-card label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 0.4rem;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg-primary, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 0.5rem;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.login-card input:focus {
    outline: none;
    border-color: var(--primary, #818cf8);
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

.login-footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.login-footer a {
    color: var(--primary, #818cf8);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ─── Pack Selection Cards ────────────────────────────────────────────────── */

.pack-card {
    transition: all 0.2s ease;
    position: relative;
}

.pack-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.pack-card.pack-selected {
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 1px var(--accent, #6366f1);
}

.pack-badge {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.pack-checkbox {
    transition: all 0.15s ease;
    flex-shrink: 0;
}
