@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-base: #fafaf9;
    --surface: #ffffff;
    --surface-border: #e7e5e4;
    --text-main: #1c1917;
    --text-muted: #78716c;
    --primary: #15803d; /* سبز نهال ارگانیک */
    --primary-hover: #166534;
    --primary-light: #dcfce7;
    --accent: #22c55e;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 20px 0 rgba(0, 0, 0, 0.03);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* افکت ارگانیک پس‌زمینه */
.background-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.45;
}

.glow-1 {
    width: 350px;
    height: 350px;
    background: #bbf7d0;
    top: -100px;
    right: -100px;
}

.glow-2 {
    width: 400px;
    height: 400px;
    background: #e2e8f0;
    bottom: -150px;
    left: -150px;
}

.form-wrapper {
    width: 100%;
    max-width: 680px;
    position: relative;
    z-index: 1;
}

/* هدر برندینگ */
.brand-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo-mark {
    width: 54px;
    height: 54px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.brand-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.brand-tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* نوار پیشرفت */
.progress-section {
    background: var(--surface);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-badge {
    color: var(--primary);
}

.progress-percent {
    color: var(--text-muted);
}

.progress-track {
    height: 6px;
    background: var(--surface-border);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.4s ease;
}

.step-names {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.step-name.active {
    color: var(--primary);
    font-weight: 700;
}

/* کارت‌ها و کانتینر اصلی */
.card, .survey-form {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-soft);
}

.intro-card {
    text-align: center;
    line-height: 1.8;
}

.intro-card h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.intro-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.intro-info {
    display: flex;
    justify-content: space-around;
    background: var(--bg-base);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 28px;
    border: 1px dashed var(--surface-border);
}

/* سوالات و فیلدها */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.step-header {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 12px;
}

.step-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.step-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.question-node {
    margin-bottom: 24px;
    transition: var(--transition);
}

.q-label {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--surface-border);
    border-radius: 50%;
    font-size: 0.75rem;
    margin-right: 8px;
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
}

.tooltip-trigger:hover::after, .tooltip-trigger.active::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 130%;
    right: 50%;
    transform: translateX(50%);
    background: #292524;
    color: #fff;
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.input-field {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    background: var(--bg-base);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.input-field:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.ltr-input {
    direction: ltr;
    text-align: left;
}

.textarea-field {
    resize: vertical;
    min-height: 80px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* کارت‌های انتخابی */
.card-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.option-card {
    border: 1px solid var(--surface-border);
    background: var(--bg-base);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    transition: var(--transition);
    user-select: none;
}

.option-card input {
    margin-left: 8px;
    accent-color: var(--primary);
}

.option-card:hover {
    border-color: #a8a29e;
}

.option-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-hover);
    font-weight: 600;
}

/* آپلودر فایل */
.upload-dropzone {
    border: 2px dashed var(--surface-border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    background: var(--bg-base);
    transition: var(--transition);
    color: var(--text-muted);
}

.upload-dropzone:hover {
    border-color: var(--primary);
    background: #f0fdf4;
}

.dropzone-text span {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

.file-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f4f4f5;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    font-size: 0.85rem;
}

.btn-remove-file {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-weight: 600;
}

/* دکمه‌ها و ناوبری */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    border-top: 1px solid var(--surface-border);
    padding-top: 18px;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary, .btn-submit {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover, .btn-submit:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #e7e5e4;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #d6d3d1;
}

.error-msg {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.question-node.has-error .error-msg {
    display: block;
}

.question-node.has-error .input-field {
    border-color: var(--danger);
}

/* صفحه پیام موفقیت و رهگیری */
.success-card {
    text-align: center;
    padding: 40px 24px;
}

.success-icon {
    margin-bottom: 16px;
}

.tracking-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 24px auto;
    max-width: 320px;
}

.tracking-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tracking-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 4px;
    margin: 8px 0 14px;
    direction: ltr;
}

.btn-copy {
    background: #fff;
    border: 1px solid #86efac;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--primary-hover);
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-copy:hover {
    background: var(--primary-light);
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 50%;
    transform: translateX(50%);
    background: #1c1917;
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 100;
}

.toast.show {
    opacity: 1;
}

.hidden { display: none !important; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ریسپانسیو موبایل */
@media (max-width: 600px) {
    .card, .survey-form { padding: 20px 16px; }
    .grid-2, .card-options-grid { grid-template-columns: 1fr; }
    .step-names { display: none; }
    .brand-title { font-size: 1.2rem; }
}