/* ظاهر صفحه ورود و حساب کاربری — هم‌خوان با جعبه ابزار */
@font-face { font-family: 'Vazirmatn'; font-weight: 400; font-display: swap;
    src: url('https://cdn.jsdelivr.net/npm/vazirmatn@33.0.3/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 600; font-display: swap;
    src: url('https://cdn.jsdelivr.net/npm/vazirmatn@33.0.3/fonts/webfonts/Vazirmatn-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 700; font-display: swap;
    src: url('https://cdn.jsdelivr.net/npm/vazirmatn@33.0.3/fonts/webfonts/Vazirmatn-Bold.woff2') format('woff2'); }

:root {
    --ink: #3d4757;
    --ink-soft: #7b8794;
    --ink-faint: #a6b0bd;
    --line: #ecebf1;
    --field: #f8f8fb;
    --accent: #f0a04b;
    --mono: ui-monospace, 'SFMono-Regular', 'Menlo', 'Consolas', 'Roboto Mono', monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 32px 16px;
    font-family: 'Vazirmatn', -apple-system, 'Segoe UI', 'Noto Naskh Arabic', Roboto, Tahoma, sans-serif;
    background: linear-gradient(150deg, #ffe9c9 0%, #ffd6c0 55%, #ffc9d4 100%);
    background-attachment: fixed;
    color: var(--ink);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.card {
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    padding: 26px 24px;
    box-shadow: 0 18px 45px rgba(90, 70, 60, 0.12), 0 2px 8px rgba(90, 70, 60, 0.05);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.card.narrow { max-width: 400px; text-align: center; }

.stack { width: 100%; max-width: 620px; display: flex; flex-direction: column; gap: 18px; }

.brand-icon {
    width: 56px; height: 56px; margin: 0 auto 12px;
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    color: #c97a2a;
    background: linear-gradient(145deg, #fff3e2, #ffe4c4);
    box-shadow: inset 0 0 0 1px rgba(240, 160, 75, 0.25);
}
.brand-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

h1, h2 { margin: 0 0 4px; font-weight: 700; letter-spacing: -0.2px; }
h1 { font-size: 21px; }
h2 { font-size: 18px; }
.sub { margin: 0 0 18px; font-size: 13px; color: var(--ink-soft); font-weight: 500; }

form { display: flex; flex-direction: column; gap: 12px; text-align: right; }

label { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
label > span { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--field);
    font-family: var(--mono);
    font-size: 16px;
    color: var(--ink);
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(240, 160, 75, 0.16); }

.row2 { display: flex; gap: 10px; }
.row-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.check { flex-direction: row; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; flex: none; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.btn {
    min-height: 48px;
    padding: 11px 16px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: #5a6d84;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
    transition: transform .18s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: #ef7a6d; margin-top: 4px; }
.btn.ghost { background: #eef1f7; color: var(--ink-soft); box-shadow: none; min-height: 40px; font-size: 13.5px; }
.btn.small { min-height: 38px; padding: 7px 12px; font-size: 13px; box-shadow: none; white-space: nowrap; }
.btn.danger { background: #e8664f; }

.msg {
    width: 100%;
    padding: 12px 15px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    text-align: right;
}
.stack > .msg { margin-bottom: 0; }
.msg.error { background: #fdeeea; border: 1.5px solid #f7dcd7; color: #c9503a; }
.msg.ok { background: #eafaf1; border: 1.5px solid #c9ecd9; color: #2f9165; }

.topbar { display: flex; align-items: center; justify-content: space-between; }
.topbar a {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 13px; border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600;
    box-shadow: 0 4px 12px rgba(90, 70, 60, 0.08);
}
.topbar a.logout { color: #c9503a; }
.topbar svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.users { display: flex; flex-direction: column; gap: 8px; }
.user {
    padding: 11px 13px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: var(--field);
    display: flex; flex-direction: column; gap: 9px;
}
.user-head { display: flex; align-items: center; gap: 8px; }
.user-name { font-family: var(--mono); font-weight: 700; font-size: 14.5px; }
.tag { font-size: 11.5px; font-weight: 700; padding: 1px 9px; border-radius: 20px; background: #fff1de; color: #b06a1f; }
.tag.me { background: #e2ebfa; color: #4a7bc4; }
.user-actions { display: flex; gap: 8px; }
form.inline { flex-direction: row; gap: 8px; align-items: center; }
form.inline:first-child { flex: 1; }
form.inline input { padding: 8px 11px; font-size: 14px; }

fieldset.panels {
    margin: 0;
    padding: 10px 12px 12px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
}
fieldset.panels:disabled { opacity: .45; }
fieldset.panels legend {
    padding: 0 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-soft);
}
fieldset.panels .check { font-size: 13px; font-weight: 600; }
.link {
    margin-right: 6px;
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: #d0832f;
    cursor: pointer;
}
.panels-form { gap: 8px; }
.panels-form .btn { align-self: flex-start; }
.user-panels-note { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }

.footer { font-size: 14px; color: rgba(61, 71, 87, 0.75); font-weight: 600; }

@media (max-width: 560px) {
    .card { padding: 22px 18px; border-radius: 20px; }
    .row2 { flex-direction: column; }
    .user-actions { flex-direction: column; }
    fieldset.panels { grid-template-columns: 1fr; }
}

/* --- اتصال گوگل درایو --- */
.gd-status {
    margin-bottom: 14px;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
}
.gd-status.on { background: #eafaf1; border: 1.5px solid #c9ecd9; color: #2f9165; }
.gd-status.off { background: #f4f5f8; border: 1.5px solid var(--line); color: var(--ink-soft); }
.hint { margin: 0; font-size: 12px; color: var(--ink-soft); line-height: 1.9; }
.hint code {
    padding: 2px 7px;
    border-radius: 6px;
    background: #f1f2f6;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink);
    word-break: break-all;
}
.gd-actions { margin-top: 14px; }
.gd-actions form { flex-direction: row; }

/* --- صفحه‌های حریم خصوصی و شرایط --- */
.card.legal { max-width: 720px; text-align: left; font-size: 14.5px; }
.card.legal h2 { margin-top: 20px; font-size: 16px; }
.card.legal ul { padding-left: 20px; }
.card.legal a { color: #c97a2a; }
.legal-links { margin-top: 22px; font-size: 13px; color: var(--ink-soft); }
