:root {
  --ink: #13253a;
  --ink-soft: #24384f;
  --paper: #f4ecdf;
  --paper-deep: #e8dcc8;
  --copper: #b56a2b;
  --saffron: #d4a017;
  --line: rgba(19, 37, 58, 0.14);
  --danger: #8b2e2e;
  --focus: #1f4d7a;
  --shadow: 0 18px 40px rgba(19, 37, 58, 0.12);
  --radius: 14px;
  --font: "Vazirmatn", "Tahoma", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.panel-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(212, 160, 23, 0.18), transparent 32%),
    radial-gradient(circle at 85% 12%, rgba(181, 106, 43, 0.16), transparent 28%),
    linear-gradient(160deg, #f7f0e4 0%, #efe4d2 45%, #e7d8c0 100%);
}

.page-shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(244, 236, 223, 0.82);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.site-nav a,
.linkish {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.site-nav a:hover,
.linkish:hover {
  color: var(--copper);
}

.inline-form,
.lang-switch {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.lang-switch select {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  padding: 0.35rem 0.75rem;
  font: inherit;
}

.site-main {
  margin-top: 2rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 8rem);
}

.brand-mark {
  margin: 0 0 0.5rem;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.hero h1,
.content-section h1,
.form-section h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--ink);
}

.lead,
.section-lead {
  max-width: 36rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin: 0 0 1.5rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-panel {
  display: flex;
  justify-content: center;
}

.desk-card {
  width: min(100%, 320px);
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(19, 37, 58, 0.94), rgba(36, 56, 79, 0.92)),
    repeating-linear-gradient(
      -18deg,
      rgba(212, 160, 23, 0.08) 0 12px,
      transparent 12px 24px
    );
  box-shadow: var(--shadow);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.8rem;
  position: relative;
  overflow: hidden;
}

.desk-card::before {
  content: "";
  position: absolute;
  inset: 1.1rem;
  border: 1px solid rgba(212, 160, 23, 0.35);
  border-radius: 16px;
  pointer-events: none;
}

.desk-line {
  height: 10px;
  width: 72%;
  border-radius: 999px;
  background: rgba(244, 236, 223, 0.55);
}

.desk-line.short {
  width: 46%;
}

.desk-seal {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  margin-top: 1rem;
  background: radial-gradient(circle at 35% 30%, var(--saffron), var(--copper));
  box-shadow: 0 0 0 6px rgba(212, 160, 23, 0.18);
}

.form-section,
.content-section {
  background: rgba(244, 236, 223, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.panel-form {
  display: grid;
  gap: 1rem;
  max-width: 28rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field select,
.field textarea,
.panel-form input,
.panel-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf2;
  color: var(--ink);
  padding: 0.7rem 0.85rem;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.panel-form input:focus,
.lang-switch select:focus,
.btn:focus-visible,
.linkish:focus-visible,
.site-nav a:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(31, 77, 122, 0.22);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--ink-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--copper);
  color: var(--copper);
}

.guardian-section {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.7);
}

.guardian-section[hidden] {
  display: none !important;
}

.guardian-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.form-errors {
  border: 1px solid rgba(139, 46, 46, 0.35);
  background: rgba(139, 46, 46, 0.08);
  color: var(--danger);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.form-errors-title {
  margin: 0 0 0.4rem;
  font-weight: 700;
}

.form-errors ul {
  margin: 0;
  padding-inline-start: 1.1rem;
}

.flash-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.flash {
  border-radius: 10px;
  padding: 0.75rem 1rem;
  background: rgba(31, 77, 122, 0.1);
  border: 1px solid rgba(31, 77, 122, 0.2);
}

.flash-success {
  background: rgba(45, 106, 68, 0.1);
  border-color: rgba(45, 106, 68, 0.25);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
}

.profile-grid dt {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}

.profile-grid dd {
  margin: 0;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.data-table th,
.data-table td {
  text-align: start;
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table th {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.subhead {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.2rem;
}

.empty {
  color: var(--ink-soft);
}

.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;
}

@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .site-header {
    border-radius: 18px;
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav {
    justify-content: flex-start;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-copy,
.form-section,
.content-section {
  animation: rise-in 0.55s ease both;
}

.desk-card {
  animation: rise-in 0.7s ease 0.08s both;
}
