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

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --error: #ef4444;
    --success: #22c55e;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

.wizard-container {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

/* Header */
.wizard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.wizard-logo {
    max-height: 48px;
    width: auto;
}

.wizard-header {
    text-align: center;
    margin-bottom: 24px;
}

.wizard-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.wizard-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.lang-select {
    flex-shrink: 0;
    padding: 6px 28px 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.2s;
}

.lang-select:hover,
.lang-select:focus {
    border-color: var(--primary);
}

/* Progress */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Card */
.wizard-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    margin-bottom: 16px;
}

.step-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--card);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-textarea {
    min-height: 100px;
    resize: none;
    overflow: hidden;
}

.textarea-hint {
    font-size: 0.68rem;
    color: #b0b8c4;
    margin-top: 3px;
    text-align: right;
}

.form-error {
    color: var(--error);
    font-size: 0.82rem;
    margin-top: 4px;
}

/* Checkboxes & Radios */
.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.checkbox-item:hover,
.radio-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.checkbox-item.selected,
.radio-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.checkbox-item input,
.radio-item input {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.checkbox-item span,
.radio-item span {
    font-size: 0.95rem;
}

/* Dynamic references */
.references-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reference-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.reference-row .form-input {
    flex: 1;
}

.btn-remove-ref {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove-ref:hover {
    border-color: var(--error);
    color: var(--error);
    background: #fef2f2;
}

.btn-add-ref {
    margin-top: 10px;
    padding: 8px 16px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--primary);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-add-ref:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* Buttons */
.wizard-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-submit {
    background: var(--success);
    color: white;
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1.05rem;
}

.btn-submit:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Success */
.success-card {
    text-align: center;
    padding: 48px 32px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2.5rem;
}

.success-card h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.brief-number {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 12px 0;
    letter-spacing: 0.5px;
}

.success-card p {
    color: var(--text-muted);
}

/* Step indicators */
.step-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.step-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.step-dot.completed {
    background: var(--success);
}

/* Responsive */
@media (max-width: 480px) {
    body { padding: 12px; }
    .wizard-card { padding: 20px; }
    .wizard-header h1 { font-size: 1.25rem; }
    .wizard-actions { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
}

/* iframe mode */
body.iframe-mode {
    padding: 0;
    background: transparent;
}

.iframe-mode .wizard-container {
    max-width: 100%;
}
