* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1a202c;
    --text-light: #718096;
    --border: #e8ecf3;
    --success: #48bb78;
    --warning: #ecc94b;
    --danger: #f56565;
    --radius: 16px;
}
[data-theme="dark"] {
    --bg: #1a202c;
    --card: #2d3748;
    --text: #f7fafc;
    --text-light: #a0aec0;
    --border: #4a5568;
}

html, body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

/* ===== Header ===== */
.app-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: 900px; margin: 0 auto;
    padding: 12px 18px;
    display: flex; justify-content: space-between; align-items: center;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.brand-text h1 { font-size: 15px; font-weight: 700; }
.brand-text p { font-size: 11px; color: var(--text-light); }
.header-actions { display: flex; gap: 8px; }
.icon-btn {
    width: 40px; height: 40px;
    background: var(--bg); border: none;
    border-radius: 12px; cursor: pointer;
    font-size: 18px; color: var(--text);
    transition: 0.2s;
}
.icon-btn:hover { background: var(--border); }

/* ===== Layout ===== */
.app-main { max-width: 900px; margin: 0 auto; padding: 18px 16px 100px; }
.page { display: none; }
.page.active { display: block; animation: fadeUp 0.35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.page-header { margin-bottom: 18px; }
.page-header h2 { font-size: 19px; margin-bottom: 4px; }
.page-header p { font-size: 13px; color: var(--text-light); }

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; padding: 28px 22px;
    border-radius: 20px; margin-bottom: 22px;
    box-shadow: 0 15px 40px rgba(102,126,234,0.3);
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute;
    top: -50%; right: -20%;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.08); border-radius: 50%;
}
.hero h2 { font-size: 19px; margin-bottom: 6px; }
.hero p { font-size: 13px; opacity: 0.9; margin-bottom: 16px; }
.hero-btn {
    background: white; color: var(--primary);
    border: none; padding: 11px 20px;
    border-radius: 12px; font-weight: 700;
    cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: center; gap: 8px;
    transition: 0.3s;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.hero-btn:hover { transform: translateY(-2px); }

/* ===== Quick Cards ===== */
.quick-actions {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 10px; margin-bottom: 26px;
}
.quick-card {
    background: var(--card); padding: 16px;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer; border: 1px solid var(--border);
    transition: 0.3s;
}
.quick-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.quick-icon {
    width: 40px; height: 40px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px; margin-bottom: 9px;
}
.quick-title { font-size: 14px; font-weight: 700; }

.section-title { margin: 20px 0 12px; }
.section-title h3 { font-size: 15px; }

/* ===== Service Cards ===== */
.services-list, .popular-services {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}
.service-card {
    background: var(--card); border-radius: var(--radius);
    padding: 15px; border: 1px solid var(--border);
    cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; gap: 12px;
}
.service-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); }
.service-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 21px; flex-shrink: 0;
}
.service-info { flex: 1; min-width: 0; }
.service-name { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.service-price { font-size: 12px; color: var(--primary); font-weight: 600; }

/* ===== Search & Tabs ===== */
.search-wrap { margin-bottom: 14px; }
.search-input {
    width: 100%; padding: 13px 16px;
    border: 2px solid var(--border); border-radius: 14px;
    font-size: 13px; background: var(--card); color: var(--text);
    font-family: inherit; transition: 0.3s;
}
.search-input:focus { outline: none; border-color: var(--primary); }
.category-tabs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 14px; scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
    padding: 8px 16px; background: var(--card);
    border: 2px solid var(--border); border-radius: 30px;
    font-size: 12px; font-weight: 600; color: var(--text-light);
    cursor: pointer; white-space: nowrap; font-family: inherit; transition: 0.25s;
}
.cat-tab.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; border-color: transparent; }

/* ===== Steps ===== */
.steps { display: flex; align-items: center; justify-content: center; margin-bottom: 25px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.step-circle {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--card); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: var(--text-light);
    transition: 0.3s;
}
.step.active .step-circle { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; border-color: transparent; }
.step.completed .step-circle { background: var(--success); color: white; border-color: transparent; }
.step-label { font-size: 10px; color: var(--text-light); font-weight: 600; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 8px; margin-bottom: 20px; }

.step-content { display: none; }
.step-content.active { display: block; animation: fadeUp 0.3s ease; }

.field-label {
    display: block; font-size: 13px; font-weight: 700;
    color: var(--text); margin-bottom: 8px; margin-top: 18px;
}
.field-label:first-child { margin-top: 0; }
.field-input {
    width: 100%; padding: 14px 16px;
    background: var(--card); border: 2px solid var(--border);
    border-radius: 14px; font-size: 14px;
    font-family: inherit; transition: 0.3s; color: var(--text);
}
.field-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(102,126,234,0.1); }
textarea.field-input { resize: vertical; min-height: 80px; }

.service-preview { margin-top: 16px; }
.service-preview:empty { display: none; }
.preview-card {
    background: linear-gradient(135deg, #f6f8fb, #eef2f9);
    border-radius: 14px; padding: 18px;
    border-right: 4px solid var(--primary);
}
.preview-card h4 { font-size: 15px; margin-bottom: 6px; }
.preview-card .price { color: var(--primary); font-weight: 700; font-size: 16px; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; border: none; padding: 15px 28px;
    border-radius: 14px; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: 0.3s; font-family: inherit;
    width: 100%; margin-top: 24px;
    box-shadow: 0 8px 20px rgba(102,126,234,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(102,126,234,0.4); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
    background: var(--card); color: var(--text-light);
    border: 2px solid var(--border); padding: 15px 24px;
    border-radius: 14px; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: 0.3s; font-family: inherit;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.btn-row { display: flex; gap: 10px; margin-top: 24px; }
.btn-row .btn-primary { margin-top: 0; flex: 2; }
.btn-row .btn-secondary { flex: 1; }

.confirm-card {
    background: var(--card); border-radius: var(--radius);
    padding: 22px; border: 1px solid var(--border);
}

/* ===== Contact ===== */
.contact-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.contact-card {
    background: var(--card); border-radius: var(--radius);
    padding: 22px; text-align: center;
    border: 1px solid var(--border); transition: 0.3s;
    text-decoration: none; color: inherit; display: block;
}
.contact-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); }
.contact-icon {
    width: 52px; height: 52px; border-radius: 14px;
    margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.contact-title { font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.contact-value { font-size: 14px; font-weight: 700; }

/* ===== Messages ===== */
.message {
    padding: 16px; border-radius: 14px;
    margin-top: 16px; font-size: 14px; font-weight: 600;
    animation: fadeUp 0.3s;
}
.message.success { background: #c6f6d5; color: #22543d; border-right: 4px solid var(--success); }
.message.error { background: #fed7d7; color: #742a2a; border-right: 4px solid var(--danger); }

/* ===== Bottom Nav ===== */
.bottom-nav {
    position: fixed; bottom: 0; right: 0; left: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-around;
    padding: 8px 0 10px; z-index: 100;
    max-width: 900px; margin: 0 auto;
}
.bn-item {
    background: none; border: none;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 12px; cursor: pointer;
    color: var(--text-light); transition: all 0.25s;
    font-family: inherit; border-radius: 10px;
}
.bn-item.active { color: var(--primary); }
.bn-icon { font-size: 20px; transition: transform 0.25s; }
.bn-item.active .bn-icon { transform: translateY(-3px) scale(1.1); }
.bn-label { font-size: 10px; font-weight: 700; }

@media (min-width: 768px) {
    .quick-actions { grid-template-columns: repeat(4, 1fr); }
    .hero { padding: 40px 32px; }
    .hero h2 { font-size: 24px; }
}