/* استایل مستقل صفحه‌ی «اصلی» سایت — صفحه‌ی عمومی مشتریان، بدون نیاز به بیلد Vite. */

@font-face {
    font-family: 'Vazirmatn-Local';
    src: url('/fonts/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn-Local';
    src: url('/fonts/vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn-Local';
    src: url('/fonts/vazirmatn/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn-Local';
    src: url('/fonts/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --hm-emerald: #34d399;
    --hm-emerald-dark: #059669;
    --hm-violet: #8b5cf6;
    --hm-text: #1e293b;
    --hm-muted: #64748b;
    --hm-border: #e2e8f0;
    --hm-bg: #f8fafc;
    --hm-danger: #e11d48;
    --hm-success-bg: #ecfdf5;
    --hm-success-text: #059669;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body.home-body {
    margin: 0;
    min-height: 100vh;
    background: var(--hm-bg);
    color: var(--hm-text);
    font-family: var(--app-font, 'Vazirmatn-Local', Tahoma, sans-serif);
    direction: rtl;
    text-align: right;
    line-height: 1.7;
}

/* --- نوار اطلاعیه (partials/announcement-bar.blade.php) --- */
#site-announcement-bar > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}
#site-announcement-bar img { max-height: 48px; width: auto; max-width: 100%; object-fit: contain; }
#site-announcement-bar a { color: inherit; text-decoration: none; }
#site-announcement-bar a:hover { text-decoration: underline; text-underline-offset: 2px; }

.home-wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 20px 16px calc(32px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 480px) {
    .home-wrap { padding-inline: 12px; }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- هدر: مثل صفحه‌ی نظرات --- */
.home-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, .85);
    border: 1px solid var(--hm-border);
    border-radius: 18px;
    box-shadow: 0 2px 20px -6px rgba(15, 23, 42, .12);
    overflow: hidden;
}
.home-header::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--hm-emerald), var(--hm-violet), var(--hm-emerald));
}
.home-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.home-logo img { height: 52px; width: auto; object-fit: contain; }
.home-logo-fallback {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--hm-emerald), var(--hm-violet));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(139, 92, 246, .25);
}
.home-title { font-size: 15px; font-weight: 700; color: var(--hm-text); }

.home-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--hm-border);
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--hm-muted);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: color .15s ease, border-color .15s ease;
    white-space: nowrap;
}
.home-nav-link:hover { color: var(--hm-emerald-dark); border-color: #a7f3d0; }

.home-header-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--hm-border);
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--hm-text);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: color .15s ease, border-color .15s ease;
    white-space: nowrap;
}
.home-header-phone svg { color: #10b981; flex-shrink: 0; }
.home-header-phone:hover { color: var(--hm-emerald-dark); border-color: #a7f3d0; }

/* --- هیرو / معرفی --- */
.home-hero { text-align: center; padding: 6px 8px 22px; }
.home-hero h1 {
    font-size: clamp(20px, 4vw, 26px);
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--hm-text);
}
.home-hero p { color: var(--hm-muted); font-size: 14.5px; margin: 0; max-width: 520px; margin-inline: auto; }

/* --- کارت عمومی --- */
.home-card {
    background: #fff;
    border: 1px solid var(--hm-border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
    max-width: 460px;
    margin: 0 auto;
}
@media (max-width: 480px) { .home-card { padding: 18px; border-radius: 14px; } }

.home-card-title { font-size: 15.5px; font-weight: 700; margin: 0 0 6px; color: var(--hm-text); text-align: center; }
.home-card-desc { font-size: 13px; color: var(--hm-muted); text-align: center; margin: 0 0 18px; line-height: 1.8; }

.home-field { margin-bottom: 14px; }
.home-label { display: block; font-size: 13px; color: var(--hm-muted); margin-bottom: 6px; }
.home-input {
    width: 100%;
    background: var(--hm-bg);
    border: 1px solid var(--hm-border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--hm-text);
    font-size: 14.5px;
    font-family: inherit;
    outline: none;
    text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.home-input::placeholder { color: #94a3b8; }
.home-input:focus { border-color: var(--hm-violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }
.home-input--otp { letter-spacing: .5em; font-size: 18px; font-weight: 700; }

.home-error { margin-top: 6px; font-size: 12px; color: var(--hm-danger); text-align: center; min-height: 15px; }
.home-hint { margin-top: 8px; font-size: 12px; color: #94a3b8; text-align: center; }

.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 13px 18px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--hm-emerald), var(--hm-violet));
    cursor: pointer;
    transition: filter .15s ease, opacity .15s ease;
}
.home-btn:hover { filter: brightness(.96); }
.home-btn:disabled { opacity: .6; cursor: default; }

.home-links-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    font-size: 12.5px;
    flex-wrap: wrap;
}
.home-link-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--hm-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.home-link-btn--accent { color: var(--hm-emerald-dark); }
.home-link-btn:disabled { color: #cbd5e1; cursor: default; text-decoration: none; }

/* --- پیام‌ها --- */
.home-alert {
    max-width: 460px;
    margin: 0 auto 18px;
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.home-alert-icon { flex-shrink: 0; width: 19px; height: 19px; }
.home-alert-info { background: #eff6ff; color: #1d4ed8; }
.home-alert-success { background: #dcfce7; color: #16a34a; }
.home-alert-warning { background: #fef3c7; color: #b45309; }

/* --- مرحله‌ی سوم: فهرست وام‌های فعال --- */
.home-loans-wrap { max-width: 560px; margin: 0 auto; }
.home-loans-head { text-align: center; margin-bottom: 16px; }
.home-loans-head h2 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.home-loans-head p { font-size: 13px; color: var(--hm-muted); margin: 0; }

.home-loan-card {
    display: block;
    width: 100%;
    text-align: right;
    background: #fff;
    border: 1px solid var(--hm-border);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.home-loan-card:hover { border-color: var(--hm-emerald); box-shadow: 0 4px 14px rgba(5, 150, 105, .12); transform: translateY(-1px); }

.home-loan-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.home-loan-name { font-size: 14.5px; font-weight: 700; color: var(--hm-text); }
.home-loan-ref { font-size: 11.5px; color: #94a3b8; direction: ltr; display: inline-block; }
.home-loan-badge {
    flex-shrink: 0;
    background: #dcfce7;
    color: #16a34a;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}

.home-loan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
@media (max-width: 420px) { .home-loan-grid { grid-template-columns: repeat(2, 1fr); } }
.home-loan-grid--2 { grid-template-columns: repeat(2, 1fr); }
.home-loan-stat { background: var(--hm-bg); border-radius: 10px; padding: 8px 6px; text-align: center; }
.home-loan-stat-label { font-size: 10.5px; color: var(--hm-muted); margin-bottom: 3px; }
.home-loan-stat-value { font-size: 12.5px; font-weight: 700; color: var(--hm-text); }

.home-loan-progress-wrap { margin-bottom: 14px; }
.home-loan-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--hm-muted);
    margin-bottom: 6px;
}
.home-loan-progress-count { font-weight: 700; color: var(--hm-text); }
.home-loan-progress-track {
    background: var(--hm-bg);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}
.home-loan-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--hm-emerald), var(--hm-emerald-dark));
    transition: width .3s ease;
}

.home-loan-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--hm-emerald-dark);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 999px;
    padding: 10px;
}

.home-empty-state {
    text-align: center;
    padding: 28px 16px;
    color: var(--hm-muted);
    font-size: 13.5px;
    background: #fff;
    border: 1px dashed var(--hm-border);
    border-radius: 14px;
}
.home-empty-state svg { margin: 0 auto 10px; color: #cbd5e1; }

.home-back-row { text-align: center; margin-top: 18px; }

.home-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: home-spin .7s linear infinite;
    display: inline-block;
}
@keyframes home-spin { to { transform: rotate(360deg); } }

.home-hidden { display: none !important; }

/* --- فوتر: مثل صفحه‌ی نظرات --- */
.home-footer {
    position: relative;
    margin-top: 32px;
    padding: 22px 20px;
    background: rgba(255, 255, 255, .85);
    border: 1px solid var(--hm-border);
    border-radius: 18px;
    box-shadow: 0 2px 20px -6px rgba(15, 23, 42, .12);
    overflow: hidden;
}
.home-footer::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--hm-emerald), var(--hm-violet), var(--hm-emerald));
}
.home-footer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.home-footer-title { font-size: 15px; font-weight: 700; color: var(--hm-text); margin: 0 0 6px; }
.home-footer-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--hm-muted);
    margin-top: 4px;
}
.home-footer-line svg { flex-shrink: 0; }
.home-enamad-placeholder {
    width: 92px; height: 92px;
    border: 2px dashed var(--hm-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.5;
    padding: 6px;
    flex-shrink: 0;
}
.home-footer-bottom {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    font-size: 13px;
    color: var(--hm-muted);
}

#toast {
    position: fixed;
    bottom: 20px;
    right: 50%;
    transform: translateX(50%) translateY(20px);
    background: #1e293b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 100;
    max-width: 90vw;
    text-align: center;
}
#toast.show { opacity: 1; transform: translateX(50%) translateY(0); }
