/* استایل رزرو زمین چمن — راست‌به‌چپ فارسی */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg1: #0b3d2e;
    --bg2: #14532d;
    --primary: #16a34a;
    --primary-dark: #15803d;
    --text: #1e293b;
    --muted: #64748b;
    --error: #dc2626;
    --card: #ffffff;
}

/* فونت وزیرمتن — محلی (بدون نیاز به اینترنت) */
@font-face {
    font-family: Vazirmatn;
    src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400; font-display: swap;
}
@font-face {
    font-family: Vazirmatn;
    src: url('fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500; font-display: swap;
}
@font-face {
    font-family: Vazirmatn;
    src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700; font-display: swap;
}

body {
    font-family: Vazirmatn, Tahoma, sans-serif;
    background: linear-gradient(135deg, var(--bg1), var(--bg2));
    min-height: 100vh;
    color: var(--text);
    padding-bottom: 40px;
}

/* ---------- ورود ---------- */
.page { width: 100%; max-width: 400px; margin: 60px auto; padding: 0 16px; }

.card {
    background: var(--card);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    text-align: center;
}
.logo { font-size: 44px; margin-bottom: 8px; }
h1 { font-size: 22px; margin-bottom: 6px; }
.subtitle { font-size: 13px; color: var(--muted); line-height: 1.9; margin-bottom: 20px; }
.step { display: none; }
.step.active { display: block; }

label { display: block; text-align: right; font-size: 13px; font-weight: 700; margin-bottom: 6px; }

input[type="tel"], input[type="text"], input[type="password"], select {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    font-family: inherit;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    background: #f8fafc;
}
input:focus, select:focus { border-color: var(--primary); background: #fff; }

.btn {
    width: 100%;
    padding: 12px;
    margin-top: 14px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled, .disabled-btn { opacity: .55; cursor: not-allowed; }
.btn.small { width: auto; padding: 8px 16px; margin-top: 0; font-size: 13px; }
.btn.inline { width: auto; padding: 10px 22px; }

.link-btn {
    background: none; border: none; color: var(--primary);
    font-family: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 4px;
}
.link-btn.danger { color: var(--error); }

.msg { font-size: 13px; min-height: 20px; margin-top: 8px; text-align: right; }
.msg.error { color: var(--error); }
.sent-to { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.resend-row { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- ناوبری ---------- */
.topnav {
    display: flex; gap: 8px; align-items: center;
    background: rgba(0,0,0,.25);
    padding: 12px 20px;
    flex-wrap: wrap;
}
.topnav.admin { background: #1f2937; }
.brand { color: #fff; font-weight: 700; margin-left: auto; }
.navbtn {
    color: #fff; text-decoration: none; font-size: 13px;
    padding: 7px 14px; border-radius: 8px; background: rgba(255,255,255,.12);
}
.navbtn:hover, .navbtn.active { background: var(--primary); }
.navbtn.light { background: rgba(220,38,38,.85); }

/* ---------- محتوا ---------- */
.container { max-width: 900px; margin: 24px auto; padding: 0 16px; }
.container h2 { color: #fff; font-size: 19px; margin-bottom: 10px; }
.sec-title { color: #fff; font-size: 16px; margin: 26px 0 12px; }

.welcome {
    background: #fff; border-radius: 16px; padding: 20px; text-align: center;
}
.welcome h2 { color: var(--text); }

.alert {
    padding: 12px 16px; border-radius: 12px; margin: 14px 0; font-size: 14px; line-height: 1.9;
}
.alert-ok  { background: #dcfce7; color: #166534; }
.alert-err { background: #fee2e2; color: #991b1b; }

/* ---------- توست (اعلان شناور) ---------- */
#ftoasts {
    position: fixed; top: 14px; left: 14px; z-index: 99999;
    display: flex; flex-direction: column; gap: 8px; max-width: 340px;
}
.ftoast {
    display: flex; align-items: flex-start; gap: 10px;
    background: #fff; color: #1e293b;
    border-radius: 14px; padding: 12px 14px;
    box-shadow: 0 12px 32px rgba(15,23,42,.25);
    font-size: 13px; line-height: 1.9;
    animation: ftIn .25s ease;
    border-inline-start: 4px solid #16a34a;
}
.ftoast.ferr { border-inline-start-color: #dc2626; }
.ftoast .fico { font-size: 18px; line-height: 1.4; }
.ftoast .ftxt { flex: 1; word-break: break-word; }
.ftoast .fx {
    background: none; border: none; color: #94a3b8; font-size: 16px;
    cursor: pointer; padding: 0 2px; font-family: inherit;
}
.ftoast.fout { animation: ftOut .25s ease forwards; }
@keyframes ftIn  { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes ftOut { to   { opacity: 0; transform: translateY(-14px); } }

/* ---------- مودال (پاپ‌آپ) ---------- */
.fmodal {
    position: fixed; inset: 0; z-index: 100000;
    display: none; align-items: center; justify-content: center; padding: 16px;
    background: rgba(2, 20, 12, .55); backdrop-filter: blur(3px);
}
.fmodal.fopen { display: flex; }
.fmodal .fbox {
    background: #fff; border-radius: 20px; max-width: 360px; width: 100%;
    padding: 26px 22px; text-align: center;
    box-shadow: 0 24px 70px rgba(0,0,0,.4);
    animation: fmIn .22s ease;
}
@keyframes fmIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.fmodal .fico2 { font-size: 46px; }
.fmodal .ftitle { font-size: 17px; font-weight: 700; margin: 8px 0 6px; color: #166534; }
.fmodal.fis-err .ftitle { color: #b91c1c; }
.fmodal .ftext { font-size: 13.5px; color: #334155; line-height: 2; }
.fmodal .fbtns { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.fmodal .fbtns a, .fmodal .fbtns button {
    padding: 9px 18px; border-radius: 10px; border: none; cursor: pointer;
    font-family: inherit; font-size: 13px; text-decoration: none;
}
.fmodal .fb-main { background: #16a34a; color: #fff; }
.fmodal .fb-light { background: #e2e8f0; color: #334155; }

.empty { background: #fff; border-radius: 12px; padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }
.empty a { color: var(--primary); }

/* ---------- روزها و سانس‌ها ---------- */
.days { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.day-pill {
    background: #fff; color: var(--text); text-decoration: none; font-size: 13px;
    padding: 9px 14px; border-radius: 999px; border: 2px solid transparent;
}
.day-pill:hover { border-color: var(--primary); }
.day-pill.selected { background: var(--primary); color: #fff; }
.day-pill.weekend { background: #fef3c7; }
.day-pill.weekend.selected { background: #d97706; color: #fff; }
.day-pill.disabled { opacity: .45; cursor: not-allowed; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.slot-card {
    background: #fff; border-radius: 16px; padding: 18px; text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.slot-card.taken { opacity: .55; }
.slot-time { font-size: 18px; font-weight: 700; color: var(--primary-dark); }
.slot-field { font-size: 13px; color: var(--muted); margin: 4px 0; }
.slot-price { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.tag { background: #fde68a; font-size: 11px; border-radius: 6px; padding: 2px 8px; margin-right: 6px; }

/* ---------- جدول ---------- */
.table-wrap { background: #fff; border-radius: 16px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
th, td { padding: 11px 10px; text-align: right; border-bottom: 1px solid #f1f5f9; }
th { background: #f8fafc; font-size: 12px; color: var(--muted); }
tr:hover td { background: #f8fafc; }

.badge { font-size: 11px; padding: 4px 10px; border-radius: 999px; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.err { background: #fee2e2; color: #991b1b; }
.badge.mutedb { background: #e2e8f0; color: #475569; }

/* ---------- ادمین ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 14px; }
.stat { background: #fff; border-radius: 14px; padding: 16px; text-align: center; }
.stat b { display: block; font-size: 17px; color: var(--primary-dark); margin-bottom: 4px; }
.stat span { font-size: 12px; color: var(--muted); }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { background: #fff; border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; }
@media (max-width: 700px) { .panel-grid { grid-template-columns: 1fr; } }

.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-bottom: 10px; }
.inline-form input[type="text"] { width: auto; min-width: 150px; }
.inline-form label { font-size: 12px; }
.reservation-filter > label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.75);
}
.reservation-filter input[type="text"] { width: 64px; min-width: 64px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.grid-form label { font-size: 12px; }
.grid-form .btn { grid-column: 1 / -1; width: 100%; }

.list { list-style: none; margin-top: 10px; }
.list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 4px; border-bottom: 1px solid #f1f5f9; font-size: 14px;
}
.kvlist { list-style: none; }
.kvlist li { display: flex; justify-content: space-between; padding: 10px 4px; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.kvlist li span { color: var(--muted); }

input.mini { width: 90px; padding: 7px 8px; font-size: 13px; }

/* ---------- 👁 چشم رمز عبور ---------- */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-left: 46px; }
.pw-eye {
    position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 18px;
    padding: 4px 7px; color: #64748b; line-height: 1;
}
.pw-eye:hover { color: var(--primary-dark); }

/* ============================================================
   ✨ پولیش مدرن — محیط خوشگل‌تر (افزودنی، بدون تغییر منطق)
   ============================================================ */
body {
    background: linear-gradient(135deg, #0b3d2e 0%, #14532d 55%, #166534 100%);
    background-attachment: fixed;
}

.card {
    box-shadow: 0 24px 70px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.65);
}

.btn {
    background: linear-gradient(135deg, #22c55e, #15803d);
    box-shadow: 0 6px 18px rgba(22,163,74,.35);
    transition: all .18s ease;
}
.btn:hover {
    background: linear-gradient(135deg, #1eb356, #166534);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(22,163,74,.45);
}
.btn:active { transform: translateY(0); }

input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 4px rgba(34,197,94,.15);
}

/* ناوبری شیشه‌ای چسبان */
.topnav {
    background: rgba(2,20,12,.38);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.topnav.admin { background: rgba(17,24,39,.93); }
.navbtn { transition: all .15s ease; }
.navbtn:hover { transform: translateY(-1px); background: var(--primary); }

/* کارت‌های سانس: بالا آمدن با هاور */
.slot-card { transition: all .18s ease; border: 1px solid #eef2f7; }
.slot-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0,0,0,.16); }
.day-pill { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.stat { border: 1px solid #eef2f7; transition: transform .15s ease; }
.stat:hover { transform: translateY(-2px); }

::selection { background: #16a34a; color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #eef1f7; }
::-webkit-scrollbar-thumb { background: #b6c0d8; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3c9; }
