/* ============================================
   متغیرهای تم (نارنجی + دارک)
   ============================================ */
:root {
    --primary: #F97316;
    --primary-dark: #EA580C;
    --primary-light: #FB923C;

    --bg: #FFFFFF;
    --surface: #F9FAFB;
    --text: #111827;
    --text-mute: #6B7280;
    --border: #E5E7EB;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.12);

    --radius: 12px;
    --radius-sm: 8px;
    --transition: all .3s ease;
}

[data-theme="dark"] {
    --primary: #FB923C;
    --primary-dark: #F97316;
    --primary-light: #FDBA74;

    --bg: #0F0F12;
    --surface: #1A1A1F;
    --text: #F3F4F6;
    --text-mute: #9CA3AF;
    --border: #2A2A32;

    --shadow: 0 4px 12px rgba(0,0,0,.4);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
}

/* ============================================
   ریست
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background .3s, color .3s;
    padding-bottom: 0;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   هدر
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,.9);
}
[data-theme="dark"] .site-header {
    background: rgba(15,15,18,.9);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 20px;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.main-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}
.nav-link {
    font-weight: 500;
    color: var(--text-mute);
    transition: var(--transition);
    position: relative;
    padding: 6px 0;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
}
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0; left: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* دکمه‌ها */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .9rem;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-icon {
    width: 42px; height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-mute);
    transition: var(--transition);
}
.btn-icon:hover {
    background: var(--surface);
    color: var(--primary);
}

/* ============================================
   Hero پارالاکس (فقط صفحه اصلی)
   ============================================ */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.hero-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100vh;
    background-size: cover;
    background-position: center;
    z-index: -1;
    will-change: transform;
}
.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.4) 0%, rgba(0,0,0,.7) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
    animation: fadeUp 1s ease;
}
.hero-content h1 {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.3;
    text-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.hero-content p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    margin-bottom: 32px;
    opacity: .95;
    text-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero .btn-primary {
    padding: 14px 32px;
    font-size: 1rem;
    box-shadow: 0 10px 30px rgba(249,115,22,.4);
}
.hero .btn-outline {
    border-color: rgba(255,255,255,.6);
    color: #fff;
    padding: 14px 32px;
    font-size: 1rem;
}
.hero .btn-outline:hover {
    background: #fff;
    color: #111;
    border-color: #fff;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   بخش‌های عمومی
   ============================================ */
.section {
    padding: 80px 0;
    position: relative;
    background: var(--bg);
    z-index: 1;
}
.section-header {
    text-align: center;
    margin-bottom: 50px;
}
.section-header h2 {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 12px;
}
.section-header p {
    color: var(--text-mute);
    max-width: 600px;
    margin: 0 auto;
}

/* گرید خدمات */
.grid {
    display: grid;
    gap: 24px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.card-icon {
    width: 56px; height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249,115,22,.1);
    color: var(--primary);
    border-radius: 14px;
    font-size: 1.5rem;
    margin-bottom: 18px;
}
.card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
}
.card p {
    color: var(--text-mute);
    font-size: .95rem;
}

/* گالری */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
}
.gallery-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.7) 100%);
    opacity: 0;
    transition: var(--transition);
}
.gallery-item:hover::after { opacity: 1; }
.gallery-item-title {
    position: absolute;
    bottom: 16px; right: 16px;
    color: #fff;
    font-weight: 600;
    z-index: 2;
    transform: translateY(10px);
    opacity: 0;
    transition: var(--transition);
}
.gallery-item:hover .gallery-item-title {
    transform: translateY(0);
    opacity: 1;
}

/* فوتر */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 60px 0 20px;
    margin-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-bottom: 40px;
}
.footer-col h4 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--primary);
}
.footer-col p, .footer-col li {
    color: var(--text-mute);
    font-size: .9rem;
    margin-bottom: 8px;
}
.footer-col a:hover { color: var(--primary); }
.footer-col i { margin-left: 8px; }
.social-links {
    display: flex;
    gap: 10px;
}
.social-links a {
    width: 38px; height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-mute);
    transition: var(--transition);
}
.social-links a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
    color: var(--text-mute);
    font-size: .85rem;
}

/* ============================================
   منوی پایین موبایل (دیجی‌کالا استایل)
   ============================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    z-index: 200;
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
    padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: .7rem;
    color: var(--text-mute);
    transition: var(--transition);
}
.mobile-nav-item i { font-size: 1.25rem; }
.mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--primary);
}

/* ============================================
   واکنش‌گرایی
   ============================================ */
@media (max-width: 992px) {
    .main-nav, .header-actions .btn-outline, .header-actions .btn-primary {
        display: none;
    }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .hero { height: 100vh; }
    .hero-bg { background-attachment: scroll; } /* موبایل با fixed مشکل داره */
    .mobile-bottom-nav { display: flex; }
    body { padding-bottom: 64px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .section { padding: 50px 0; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .header-inner { height: 60px; }
}
/* ============================================
   صفحات احراز هویت (ثبت‌نام / ورود)
   ============================================ */
.auth-page {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--surface);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.auth-card h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
    text-align: center;
}

.auth-sub {
    text-align: center;
    color: var(--text-mute);
    margin-bottom: 28px;
    font-size: .9rem;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: .9rem;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: .95rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}

.btn-block {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: .9rem;
}
.alert-error {
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.3);
    color: #dc2626;
}
.alert-success {
    background: rgba(34,197,94,.1);
    border: 1px solid rgba(34,197,94,.3);
    color: #16a34a;
}
.alert-error p {
    margin-bottom: 6px;
}
.alert-error p:last-child {
    margin-bottom: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: .9rem;
    color: var(--text-mute);
}
.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   ریسپانسیو
   ============================================ */
@media (max-width: 480px) {
    .auth-card {
        padding: 28px 22px;
    }
}

/* ============================================
   دکمه‌های هدر (پروفایل / خروج)
   ============================================ */
.btn-logout {
    color: #dc2626 !important;
    border-color: rgba(220,38,38,.3) !important;
}
.btn-logout:hover {
    background: rgba(220,38,38,.08) !important;
    border-color: #dc2626 !important;
}

.hide-mobile {
    display: inline;
}

/* ============================================
   نوار پایین موبایل - دکمه خروج
   ============================================ */
.mobile-nav-logout {
    color: #dc2626 !important;
}
.mobile-nav-logout i {
    color: #dc2626;
}

/* ============================================
   ریسپانسیو - مخفی کردن متن‌ها در موبایل
   ============================================ */
@media (max-width: 992px) {
    .hide-mobile {
        display: none !important;
    }
}

/* ============================================
   وسط‌چین کردن فرم لاگین
   ============================================ */
.auth-card {
    text-align: center;
}

.auth-card .form-group {
    text-align: center;
}

.auth-card .form-group label {
    text-align: center;
    display: block;
}

.auth-card .form-group input {
    text-align: center;
}

.auth-card .btn-block {
    text-align: center;
}

/* ============================================
   واضح‌تر کردن باکس‌های غیرفعال (readonly)
   ============================================ */
.form-group input:disabled,
.form-group input[readonly] {
    background: var(--surface);
    color: var(--text-mute);
    border-style: dashed;
    cursor: not-allowed;
    opacity: 0.8;
}

.form-group input:disabled::placeholder,
.form-group input[readonly]::placeholder {
    color: var(--text-mute);
    opacity: 0.7;
}

/* ============================================
   نمایش واضح فیلدهای غیرقابل ویرایش
   ============================================ */
.form-group.readonly-field {
    position: relative;
}

.form-group.readonly-field::after {
    content: '🔒';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    opacity: 0.6;
    pointer-events: none;
}

.form-group.readonly-field input {
    padding-left: 36px;
    background: var(--surface);
    border-style: dashed;
    cursor: not-allowed;
}

/* ============================================
   وسط‌چین کردن فرم لاگین
   ============================================ */
.auth-card {
    text-align: center;
}

.auth-card .form-group {
    text-align: center;
}

.auth-card .form-group label {
    text-align: center;
    display: block;
}

.auth-card .form-group input {
    text-align: center;
}

.auth-card .btn-block {
    text-align: center;
}
.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: .85rem;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    padding: 0 4px;
}