/* ═══════════════════════════════════════════════════════
   Cafenet — Design System v3 "Modern"
   اصول: Clarity (Apple) + Restraint (Airbnb) + Modular (Digikala)
   ═══════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
    /* Brand — نارنجی گرم (قهوه + انرژی) */
    --brand-50: #FFF7ED;
    --brand-100: #FFEDD5;
    --brand-200: #FED7AA;
    --brand-500: #F97316;
    --brand-600: #EA580C;
    --brand-700: #C2410C;

    /* Neutral — روشن و تمیز */
    --bg: #FAFAF9;
    --surface: #FFFFFF;
    --surface-hover: #F5F5F4;
    --border: #E7E5E4;
    --border-strong: #D6D3D1;

    /* Text */
    --text-1: #1C1917;
    --text-2: #57534E;
    --text-3: #A8A29E;

    /* Semantic */
    --success: #16A34A;
    --success-bg: #F0FDF4;
    --warning: #CA8A04;
    --warning-bg: #FEFCE8;
    --danger: #DC2626;
    --danger-bg: #FEF2F2;
    --info: #2563EB;
    --info-bg: #EFF6FF;

    /* Radius — نرم (Airbnb) */
    --r-sm: 8px;
    --r: 12px;
    --r-md: 16px;
    --r-lg: 24px;
    --r-full: 999px;

    /* Shadow — ظریف (نه سنگین) */
    --shadow-xs: 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow: 0 4px 12px rgba(28, 25, 23, 0.06), 0 1px 3px rgba(28, 25, 23, 0.04);
    --shadow-lg: 0 12px 32px rgba(28, 25, 23, 0.08), 0 4px 8px rgba(28, 25, 23, 0.04);

    /* Spacing scale — 4px base */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-8: 32px;
    --s-10: 40px;
    --s-12: 48px;
    --s-16: 64px;
    --s-20: 80px;

    /* Typography scale */
    --fs-xs: 12px;
    --fs-sm: 13px;
    --fs-base: 15px;
    --fs-md: 16px;
    --fs-lg: 18px;
    --fs-xl: 22px;
    --fs-2xl: 28px;
    --fs-3xl: 36px;
    --fs-4xl: 48px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Vazirmatn', -apple-system, 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text-1);
    min-height: 100vh;
    direction: rtl;
    line-height: 1.6;
    font-size: var(--fs-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-600); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-700); }

/* ─── Layout ─── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 var(--s-5); }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 var(--s-5); }

/* ─── Header ─── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--s-4);
    padding-bottom: var(--s-4);
    gap: var(--s-6);
}

/* ─── Brand ─── */
.brand {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    color: var(--text-1);
    text-decoration: none;
    flex-shrink: 0;
}
.brand:hover { color: var(--text-1); }
.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: var(--r);
    background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
    transition: transform .2s;
}
.brand:hover .brand-mark { transform: scale(1.05) rotate(-5deg); }
.brand-mark svg { width: 22px; height: 22px; color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: var(--fs-md); letter-spacing: -0.01em; }
.brand-sub { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; margin-top: 2px; }

/* ─── Nav ─── */
.site-nav { display: flex; align-items: center; gap: var(--s-1); flex-wrap: wrap; }
.site-nav a {
    color: var(--text-2);
    font-size: var(--fs-sm);
    font-weight: 500;
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-sm);
    transition: all .15s;
    white-space: nowrap;
}
.site-nav a:hover {
    color: var(--text-1);
    background: var(--surface-hover);
}
.site-nav .nav-cta {
    background: var(--brand-500);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}
.site-nav .nav-cta:hover {
    background: var(--brand-600);
    color: #fff;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

/* ─── Mobile nav toggle ─── */
@media (max-width: 640px) {
    .site-nav { display: none; }
    .site-nav.open { display: flex; width: 100%; justify-content: center; margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--border); }
}

/* ─── Hero ─── */
.hero {
    padding: var(--s-16) 0 var(--s-12);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.04) 0%, transparent 70%);
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: var(--s-6);
    box-shadow: var(--shadow-xs);
}
.hero-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
    animation: pulse 2s infinite;
}

.hero h1 {
    font-size: clamp(32px, 5vw, var(--fs-4xl));
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: var(--s-5);
    color: var(--text-1);
}
.hero h1 .accent {
    color: var(--brand-500);
    position: relative;
    display: inline-block;
}
.hero h1 .accent::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    left: 0;
    height: 6px;
    background: var(--brand-200);
    border-radius: 3px;
    z-index: -1;
}

.hero-lead {
    font-size: clamp(15px, 2vw, var(--fs-lg));
    color: var(--text-2);
    max-width: 580px;
    margin: 0 auto var(--s-8);
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: var(--s-3);
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-5);
    border-radius: var(--r-sm);
    background: var(--brand-500);
    color: #fff;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: all .15s ease;
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.06);
    white-space: nowrap;
}
.btn:hover {
    background: var(--brand-600);
    color: #fff;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
    transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible {
    outline: 3px solid var(--brand-200);
    outline-offset: 2px;
}

.btn-lg { padding: var(--s-4) var(--s-6); font-size: var(--fs-base); border-radius: var(--r); }
.btn-sm { padding: var(--s-2) var(--s-3); font-size: var(--fs-xs); }
.btn-block { width: 100%; }

.btn-ghost {
    background: var(--surface);
    color: var(--text-1);
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
}
.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text-1);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--text-1);
    color: #fff;
}
.btn-secondary:hover { background: #000; color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; color: #fff; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803D; color: #fff; }

/* ─── Forms ─── */
.form-group { margin-bottom: var(--s-5); }
label {
    display: block;
    margin-bottom: var(--s-2);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-1);
}
input, textarea, select {
    width: 100%;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-1);
    font-family: inherit;
    font-size: var(--fs-base);
    line-height: 1.5;
    transition: all .15s;
    appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, textarea:hover, select:hover { border-color: var(--text-3); }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px var(--brand-100);
}
textarea { min-height: 100px; resize: vertical; font-family: inherit; }

.form-hint {
    display: block;
    margin-top: var(--s-2);
    font-size: var(--fs-xs);
    color: var(--text-3);
}

/* ─── Cards ─── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--s-6);
    box-shadow: var(--shadow-xs);
}
.card + .card { margin-top: var(--s-4); }

/* ─── Flash ─── */
.flash {
    padding: var(--s-4) var(--s-5);
    border-radius: var(--r);
    margin-bottom: var(--s-5);
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
    gap: var(--s-3);
    border: 1px solid transparent;
    animation: slideDown .3s ease;
}
.flash-icon { font-size: var(--fs-lg); flex-shrink: 0; }
.flash.ok { background: var(--success-bg); color: #166534; border-color: #BBF7D0; }
.flash.err { background: var(--danger-bg); color: #991B1B; border-color: #FECACA; }

/* ─── Register Grid ─── */
.section-head {
    text-align: center;
    margin-bottom: var(--s-10);
}
.section-head h2 {
    font-size: clamp(24px, 3vw, var(--fs-2xl));
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: var(--s-2);
    color: var(--text-1);
}
.section-head p {
    color: var(--text-2);
    font-size: var(--fs-md);
}

.register-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--s-4);
}

.register-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--s-6);
    display: flex;
    flex-direction: column;
    transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}
.register-card:hover {
    border-color: var(--brand-200);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    color: inherit;
}
.register-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r);
    background: var(--brand-50);
    color: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: var(--s-4);
}
.register-card h3 {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin-bottom: var(--s-2);
    color: var(--text-1);
    line-height: 1.4;
}
.register-card p {
    color: var(--text-2);
    font-size: var(--fs-sm);
    line-height: 1.7;
    flex: 1;
    margin-bottom: var(--s-4);
}
.register-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--s-4);
    border-top: 1px solid var(--border);
    color: var(--text-3);
    font-size: var(--fs-xs);
    font-weight: 500;
}
.register-card-meta .arrow {
    color: var(--brand-500);
    transition: transform .2s;
    font-size: 18px;
}
.register-card:hover .arrow { transform: translateX(-4px); }

/* ─── Page hero ─── */
.page-hero {
    padding: var(--s-10) 0 var(--s-8);
    text-align: center;
}
.page-hero .breadcrumb {
    color: var(--text-3);
    font-size: var(--fs-xs);
    margin-bottom: var(--s-3);
    font-weight: 500;
}
.page-hero .breadcrumb a { color: var(--text-2); }
.page-hero .breadcrumb a:hover { color: var(--brand-600); }
.page-hero h1 {
    font-size: clamp(26px, 4vw, var(--fs-3xl));
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: var(--s-2);
}
.page-hero .lead { color: var(--text-2); font-size: var(--fs-md); }

/* ─── Info box ─── */
.info-box {
    background: var(--brand-50);
    border: 1px solid var(--brand-200);
    border-radius: var(--r);
    padding: var(--s-4) var(--s-5);
    margin-bottom: var(--s-4);
    display: flex;
    gap: var(--s-3);
    align-items: flex-start;
}
.info-box-icon {
    font-size: 20px;
    flex-shrink: 0;
    color: var(--brand-600);
}
.info-box-content { flex: 1; }
.info-box strong {
    display: block;
    font-size: var(--fs-sm);
    color: var(--brand-700);
    margin-bottom: var(--s-2);
    font-weight: 700;
}
.info-box p {
    color: var(--text-2);
    font-size: var(--fs-sm);
    white-space: pre-line;
    line-height: 1.7;
}

/* ─── Stats ─── */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--s-3);
    margin-bottom: var(--s-6);
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: var(--s-5) var(--s-4);
    text-align: center;
    box-shadow: var(--shadow-xs);
    transition: all .15s;
}
.stat:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}
.stat strong {
    display: block;
    font-size: var(--fs-2xl);
    font-weight: 800;
    margin-bottom: var(--s-1);
    color: var(--text-1);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.stat.accent strong { color: var(--brand-500); }
.stat.success strong { color: var(--success); }
.stat.warning strong { color: var(--warning); }
.stat.info strong { color: var(--info); }
.stat span { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }

/* ─── Tables ─── */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}
table { width: 100%; border-collapse: collapse; }
table th {
    background: var(--bg);
    padding: var(--s-3) var(--s-4);
    text-align: right;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border);
}
table td {
    padding: var(--s-4);
    text-align: right;
    font-size: var(--fs-sm);
    border-bottom: 1px solid var(--border);
    color: var(--text-1);
    vertical-align: middle;
}
table tbody tr { transition: background .1s; }
table tbody tr:hover { background: var(--surface-hover); }
table tbody tr:last-child td { border-bottom: none; }

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: 600;
    white-space: nowrap;
}
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-claimed { background: #DBEAFE; color: #1E40AF; }
.badge-done { background: #DCFCE7; color: #166534; }
.badge-off { background: #F3F4F6; color: #6B7280; }

/* ─── Typography ─── */
h2 {
    font-size: var(--fs-xl);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: var(--s-4);
    color: var(--text-1);
}
h3 {
    font-size: var(--fs-md);
    font-weight: 700;
    margin-bottom: var(--s-3);
    color: var(--text-1);
}
.muted { color: var(--text-3); font-size: var(--fs-sm); }
.text-secondary { color: var(--text-2); }

/* ─── Empty ─── */
.empty {
    text-align: center;
    padding: var(--s-12) var(--s-6);
    color: var(--text-3);
}
.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: var(--s-4);
    opacity: 0.6;
}
.empty h3 {
    color: var(--text-1);
    font-size: var(--fs-lg);
    margin-bottom: var(--s-2);
}
.empty p { font-size: var(--fs-sm); margin-bottom: var(--s-5); }

/* ─── Auth ─── */
.auth-wrap {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-10) var(--s-5);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-10) var(--s-8);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp .4s ease;
}
.auth-logo {
    width: 60px;
    height: 60px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--s-5);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3);
}
.auth-logo svg { width: 30px; height: 30px; color: #fff; }
.auth-card h2 {
    text-align: center;
    font-size: var(--fs-xl);
    margin-bottom: var(--s-2);
}
.auth-sub {
    text-align: center;
    color: var(--text-3);
    font-size: var(--fs-sm);
    margin-bottom: var(--s-6);
}

/* ─── Panel header ─── */
.panel-header {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    border-radius: var(--r-md);
    padding: var(--s-8) var(--s-6);
    color: #fff;
    margin-bottom: var(--s-6);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.2);
}
.panel-header::after {
    content: '';
    position: absolute;
    top: -60px;
    left: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}
.panel-header h2 {
    color: #fff;
    margin-bottom: var(--s-1);
    font-size: var(--fs-2xl);
    position: relative;
}
.panel-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--fs-sm);
    position: relative;
}

/* ─── Row / Grid ─── */
.row { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* ─── Request card ─── */
.request-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: var(--s-4);
    margin-bottom: var(--s-3);
    transition: border-color .15s;
}
.request-card:hover { border-color: var(--border-strong); }
.request-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s-4);
    flex-wrap: wrap;
}
.request-info { flex: 1; min-width: 220px; }
.request-name {
    font-weight: 700;
    font-size: var(--fs-md);
    color: var(--text-1);
    margin-bottom: var(--s-1);
}
.request-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--info);
    font-weight: 700;
    font-size: var(--fs-md);
    direction: ltr;
    margin-top: var(--s-2);
    text-decoration: none;
}
.request-phone:hover { text-decoration: underline; }
.request-meta {
    font-size: var(--fs-xs);
    color: var(--text-3);
    margin-top: var(--s-2);
    display: flex;
    gap: var(--s-3);
    flex-wrap: wrap;
}

/* ─── Footer ─── */
.site-footer {
    margin-top: var(--s-16);
    padding: var(--s-8) 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-4);
    font-size: var(--fs-xs);
    color: var(--text-3);
}
.site-footer .footer-brand {
    font-weight: 700;
    color: var(--text-1);
}

/* ─── Animations ─── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .6; transform: scale(.95); }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .hero { padding: var(--s-10) 0 var(--s-8); }
    .register-grid { grid-template-columns: 1fr; }
    .card { padding: var(--s-5); }
    .auth-card { padding: var(--s-8) var(--s-5); }
    .stats { grid-template-columns: repeat(2, 1fr); }
    table th, table td { padding: var(--s-3) var(--s-2); font-size: var(--fs-xs); }
}

/* ─── Utility ─── */
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: var(--s-2) !important; }
.mt-4 { margin-top: var(--s-4) !important; }
.mt-6 { margin-top: var(--s-6) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: var(--s-2) !important; }
.mb-4 { margin-bottom: var(--s-4) !important; }
.mb-6 { margin-bottom: var(--s-6) !important; }
.text-center { text-align: center; }