/* صفحه‌ی ورود و ثبت‌نام (CF\Auth\Site_Auth) — رنگ‌ها همان متغیرهای سایت (main.css) */
/* فونت در خود قالب (page-auth.php) با آدرس هم‌دامنه تعریف می‌شود */

:root {
  --c-primary: #4e60ff;
  --c-accent: #e50914;
  --c-bg: #111111;
  --c-surface: #1a1a1a;
  --c-surface-hover: #2c2c2c;
  --c-border: rgba(255, 255, 255, 0.1);
  --c-text: #ffffff;
  --c-text-muted: #94a3b8;
  --c-ok: #22c55e;
  --c-bad: #ef4444;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { direction: rtl; }
body, button, input, select, textarea, h1, h2, h3, p, label, a, small { font-family: IRANSansX, Tahoma, sans-serif; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: IRANSansX, Tahoma, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(78, 96, 255, .22), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, rgba(229, 9, 20, .14), transparent 60%),
              var(--c-bg);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
}
.ltr { direction: ltr; text-align: left; }
[hidden] { display: none !important; }

.cfa { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.cfa-card {
  width: 100%; max-width: 400px; background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: 16px; padding: 24px 22px 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.cfa-logo { display: block; text-align: center; margin-bottom: 18px; }
.cfa-logo img { width: auto; height: 40px; max-width: 170px; }

.cfa-tabs { display: flex; gap: 6px; background: var(--c-bg); border-radius: var(--radius); padding: 4px; margin-bottom: 18px; }
.cfa-tab {
  flex: 1; border: 0; background: transparent; color: var(--c-text-muted); font: inherit; font-weight: 700;
  padding: 9px 0; border-radius: 8px; cursor: pointer; transition: .15s;
}
.cfa-tab.is-on { background: var(--c-primary); color: #fff; }
.cfa-tabs.is-hidden { display: none; }

.cfa-view { display: none; }
.cfa-view.is-on { display: block; animation: cfa-in .2s ease; }
@keyframes cfa-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.cfa-h { font-size: 1.05rem; font-weight: 700; margin: 0 0 14px; text-align: right; }
.cfa-card, .cfa-field, .cfa-alert, .cfa-note { text-align: right; }
.cfa-field { margin-bottom: 14px; }
.cfa-field label { display: block; font-size: .85rem; font-weight: 500; color: var(--c-text-muted); margin-bottom: 6px; }
.cfa-field small { display: block; font-size: .75rem; color: var(--c-text-muted); margin-top: 4px; }
.cfa-opt { font-size: .75rem; opacity: .8; }
.cfa-input {
  width: 100%; height: 44px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--c-border);
  background: var(--c-bg); color: var(--c-text); font: inherit; font-size: .95rem; outline: none; transition: border-color .15s;
}
.cfa-input:focus { border-color: var(--c-primary); }
.cfa-input.is-bad { border-color: var(--c-bad); }
.cfa-input.is-locked { background: rgba(78, 96, 255, .12); border-color: rgba(78, 96, 255, .4); color: #c7ceff; letter-spacing: 2px; cursor: default; }
.cfa-code { letter-spacing: 6px; text-align: center; font-size: 1.2rem; }

.cfa-pass { position: relative; }
.cfa-pass .cfa-input { padding-left: 42px; }
.cfa-eye { position: absolute; left: 6px; line-height: 1; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; opacity: .55; font-size: 1rem; padding: 6px; }
.cfa-eye.is-on { opacity: 1; }

.cfa-cap-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.cfa-cap-img { width: 128px; height: 44px; border-radius: 8px; background: #161c2c; object-fit: cover; }
.cfa-cap-new { width: 36px; height: 44px; border-radius: 8px; border: 1px solid var(--c-border); background: var(--c-bg); color: var(--c-text); cursor: pointer; font-size: 1.1rem; }
.cfa-cap .cfa-input { text-transform: uppercase; letter-spacing: 3px; text-align: center; }

.cfa-check { display: flex; justify-content: flex-start; align-items: center; gap: 8px; font-size: .85rem; color: var(--c-text-muted); margin: -2px 0 14px; cursor: pointer; }
.cfa-btn {
  width: 100%; height: 46px; border: 0; border-radius: var(--radius); background: var(--c-primary); color: #fff;
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; transition: filter .15s, opacity .15s;
}
.cfa-btn:hover { filter: brightness(1.1); }
.cfa-btn[disabled] { opacity: .6; cursor: wait; }

.cfa-links { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.cfa-link { background: none; border: 0; color: var(--c-text-muted); font: inherit; font-size: .85rem; cursor: pointer; padding: 0; text-decoration: none; }
.cfa-link:hover { color: var(--c-text); }
.cfa-note { font-size: .8rem; color: var(--c-text-muted); line-height: 1.8; margin: 12px 0 0; }

.cfa-alert { border-radius: var(--radius); padding: 10px 12px; font-size: .85rem; line-height: 1.8; margin-bottom: 14px; background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .35); color: #fecaca; }
.cfa-alert.is-ok { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .35); color: #bbf7d0; }
.cfa-alert a { color: inherit; }

.cfa-done { text-align: center; padding: 18px 0 8px; }
.cfa-done-ico { width: 64px; height: 64px; line-height: 64px; margin: 0 auto 12px; border-radius: 50%; background: rgba(34, 197, 94, .15); color: var(--c-ok); font-size: 2rem; }

.cfa-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--c-border); }
.cfa-foot .cfa-link { font-size: .8rem; }

/* پشتیبانی بدون ورود */
.cfa-textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.8; resize: vertical; }
select.cfa-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--c-text-muted) 50%), linear-gradient(135deg, var(--c-text-muted) 50%, transparent 50%); background-position: 16px 19px, 11px 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-left: 28px; }
.cfa-tk-list { margin-bottom: 14px; }
.cfa-tk-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-bg); color: var(--c-text); font: inherit; font-size: .9rem; cursor: pointer; text-align: right; }
.cfa-tk-item:hover { border-color: var(--c-primary); }
.cfa-tk-item .dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; display: inline-block; margin-inline-start: 6px; }
.cfa-tk-st { font-size: .75rem; padding: 2px 10px; border-radius: 999px; background: rgba(78, 96, 255, .18); color: #c7ceff; white-space: nowrap; }
.cfa-tk-st.answered { background: rgba(34, 197, 94, .15); color: #bbf7d0; }
.cfa-tk-st.closed { background: rgba(148, 163, 184, .15); color: var(--c-text-muted); }
.cfa-tk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cfa-thread { max-height: 320px; overflow-y: auto; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.cfa-msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: .85rem; line-height: 1.9; white-space: pre-wrap; word-break: break-word; background: var(--c-bg); border: 1px solid var(--c-border); align-self: flex-start; }
.cfa-msg.staff { background: rgba(78, 96, 255, .14); border-color: rgba(78, 96, 255, .3); align-self: flex-end; }
.cfa-msg small { display: block; font-size: .7rem; color: var(--c-text-muted); margin-top: 2px; }
.cfa-ev { text-align: center; font-size: .72rem; color: var(--c-text-muted); }
.cfa-empty { font-size: .85rem; color: var(--c-text-muted); text-align: center; padding: 6px 0 4px; }

@media (max-width: 380px) {
  .cfa-card { padding: 20px 14px 14px; }
  .cfa-cap-img { width: 110px; }
}
