/* ==========================================================
   سامانه پرداخت وجه موسسه آموزشی پرتو
   پالت رنگی: زمینه کاغذی روشن + سرمه‌ای تیره (متن) + سبز زمردی
   (رنگ رسمی/اعتماد آکادمیک) + طلایی کم‌رنگ برای لهجه تزئینی
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
  --color-bg: #faf9f6;
  --color-surface: #ffffff;
  --color-ink: #1b2430;
  --color-ink-soft: #4a5568;
  --color-border: #e4e1d8;
  --color-primary: #0f5c4e;      /* سبز زمردی نهادی */
  --color-primary-dark: #0b463b;
  --color-primary-soft: #e6efec;
  --color-accent: #ab7d1f;       /* طلایی کم‌رنگ - فقط تزئینی */
  --color-danger: #b3312c;
  --color-success: #157a4a;
  --color-footer-bg: #14241f;
  --color-footer-ink: #d9e4df;

  --radius-sm: 6px;
  --radius-md: 10px;

  --shadow-card: 0 1px 2px rgba(27, 36, 48, 0.06), 0 8px 24px rgba(27, 36, 48, 0.05);

  --font-base: 'Vazirmatn', Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-ink);
  line-height: 1.7;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

/* -------------------- هدر -------------------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  flex-shrink: 0;
}

.brand__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand__name {
  font-weight: 700;
  font-size: 16px;
  color: var(--color-ink);
}

.brand__sub {
  font-size: 12px;
  color: var(--color-ink-soft);
}

/* -------------------- بخش عنوان اصلی -------------------- */
.hero {
  padding: 56px 0 32px;
  text-align: center;
}

.hero__title {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  color: var(--color-ink);
  margin: 0 0 14px;
}

.hero__rule {
  width: 64px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 3px;
  margin: 0 auto 18px;
}

.hero__subtitle {
  max-width: 560px;
  margin: 0 auto;
  color: var(--color-ink-soft);
  font-size: 15px;
}

.support-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 420px;
  margin: 24px auto 0;
  padding: 14px 22px;
  background: var(--color-primary-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.support-box__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.support-box__text {
  text-align: right;
}

.support-box__label {
  font-size: 12.5px;
  color: var(--color-ink-soft);
  margin-bottom: 2px;
}

.support-box__number {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-ink);
  letter-spacing: 0.5px;
  direction: ltr;
  display: inline-block;
}

.support-box__number a {
  color: var(--color-primary-dark);
}

@media (max-width: 420px) {
  .support-box {
    padding: 12px 16px;
    gap: 10px;
  }
  .support-box__number {
    font-size: 18px;
  }
}

/* -------------------- کارت فرم -------------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 32px;
  max-width: 560px;
  margin: 0 auto 64px;
}

@media (max-width: 480px) {
  .card {
    padding: 22px;
  }
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 8px;
}

.field .hint {
  font-size: 12px;
  color: var(--color-ink-soft);
  margin-top: 6px;
}

.field .error {
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 6px;
  display: none;
}

.field.has-error .error {
  display: block;
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--color-danger);
}

input[type="text"],
input[type="tel"],
input[type="password"],
textarea {
  width: 100%;
  font-family: var(--font-base);
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.amount-input {
  position: relative;
}

.amount-input input {
  padding-left: 58px;
}

.amount-input .suffix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--color-ink-soft);
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
}

.btn-secondary {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.btn-secondary:hover {
  background: #d9e6e1;
  text-decoration: none;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* -------------------- پیام‌های وضعیت -------------------- */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert-error {
  background: #fbebea;
  color: var(--color-danger);
  border-color: #f1c7c4;
}

.alert-success {
  background: #e7f5ee;
  color: var(--color-success);
  border-color: #bfe3d1;
}

/* -------------------- رسید پرداخت -------------------- */
.receipt {
  max-width: 480px;
  margin: 40px auto 64px;
}

.receipt__status {
  text-align: center;
  margin-bottom: 20px;
}

.receipt__status-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 30px;
}

.receipt__status-icon.success {
  background: #e7f5ee;
  color: var(--color-success);
}

.receipt__status-icon.failed {
  background: #fbebea;
  color: var(--color-danger);
}

.receipt__status-title {
  font-size: 19px;
  font-weight: 700;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.receipt-table tr {
  border-bottom: 1px dashed var(--color-border);
}

.receipt-table tr:last-child {
  border-bottom: none;
}

.receipt-table th,
.receipt-table td {
  padding: 11px 4px;
  text-align: right;
  font-weight: 400;
}

.receipt-table th {
  color: var(--color-ink-soft);
  width: 40%;
}

.receipt-table td {
  font-weight: 600;
}

.receipt-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

/* -------------------- فوتر -------------------- */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-ink);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 44px 0 28px;
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }
}

.footer-col h3 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 14px;
  position: relative;
}

.footer-col p,
.footer-col address {
  font-size: 13.5px;
  color: var(--color-footer-ink);
  margin: 0 0 8px;
  font-style: normal;
  line-height: 1.9;
}

.footer-col a {
  color: var(--color-footer-ink);
}

.footer-col a:hover {
  color: #fff;
}

.social-links {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.15s ease;
}

.social-links a:hover {
  background: var(--color-primary);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 0;
  font-size: 12.5px;
  color: rgba(217, 228, 223, 0.7);
  text-align: center;
}

/* -------------------- بدنه صفحه (چسباندن فوتر به پایین) -------------------- */
.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1;
}

/* -------------------- کمکی برای دسترسی‌پذیری -------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------- اسپینر بارگذاری دکمه -------------------- */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn.is-loading .spinner {
  display: inline-block;
}

.btn.is-loading .btn-label {
  opacity: 0.85;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   پنل ادمین
   ============================================================ */
.admin-body {
  background: var(--color-bg);
}

.admin-topbar {
  background: var(--color-footer-bg);
  color: #fff;
  padding: 14px 0;
}

.admin-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-topbar__title {
  font-weight: 700;
  font-size: 15px;
}

.admin-topbar a.logout {
  color: #f0d9a8;
  font-size: 13.5px;
}

.admin-wrap {
  max-width: 1100px;
  margin: 32px auto 60px;
  padding: 0 20px;
}

.admin-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.admin-panel h1 {
  font-size: 19px;
  margin: 0 0 4px;
}

.admin-panel .subtitle {
  color: var(--color-ink-soft);
  font-size: 13.5px;
  margin: 0 0 24px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.stat-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: #fcfcfa;
}

.stat-box .num {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-primary-dark);
}

.stat-box .label {
  font-size: 12.5px;
  color: var(--color-ink-soft);
  margin-top: 4px;
}

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-bar input {
  flex: 1;
}

.search-bar .btn {
  width: auto;
  padding: 10px 22px;
}

.table-wrap {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 720px;
}

table.data-table th,
table.data-table td {
  text-align: right;
  padding: 11px 10px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

table.data-table th {
  color: var(--color-ink-soft);
  font-weight: 600;
  background: #fbfaf7;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: #e7f5ee;
  color: var(--color-success);
}

.badge-failed {
  background: #fbebea;
  color: var(--color-danger);
}

.badge-pending {
  background: #fdf3df;
  color: #8a6417;
}

.empty-state {
  text-align: center;
  padding: 40px 10px;
  color: var(--color-ink-soft);
  font-size: 14px;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
}

.login-card .brand {
  justify-content: center;
  margin-bottom: 24px;
}

.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 22px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-ink);
}

.pagination a:hover {
  background: var(--color-primary-soft);
  text-decoration: none;
}

.pagination .current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* -------------------- حالت پرینت تمیز برای رسید -------------------- */
@media print {
  .site-header, .site-footer, .admin-topbar, .receipt-actions, .no-print {
    display: none !important;
  }
  body, .page-wrap, .admin-wrap {
    background: #fff !important;
    margin: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: none !important;
  }
}
