/* =========================================
   Role Selection — modern floating panel
   هویت سبز ماکان + ظاهر ترند
========================================= */

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body.page-role-selection {
  font-family: "Vazirmatn", system-ui, sans-serif;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  color: #0f172a;
  background: #ecfdf5;
  -webkit-font-smoothing: antialiased;
}

/* ---- Mesh background ---- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(11, 144, 78, 0.28), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(11, 144, 78, 0.22), transparent 50%),
    radial-gradient(800px 500px at 50% 110%, rgba(59, 130, 246, 0.12), transparent 45%),
    linear-gradient(160deg, #f0fdf4 0%, #f8fafc 48%, #eef2ff 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: drift 14s ease-in-out infinite alternate;
}

.b1 {
  width: 280px;
  height: 280px;
  background: #47cb68;
  top: -60px;
  right: -40px;
}

.b2 {
  width: 220px;
  height: 220px;
  background: #47cb68;
  bottom: 8%;
  left: -50px;
  animation-delay: -4s;
}

.b3 {
  width: 160px;
  height: 160px;
  background: #a3e635;
  top: 42%;
  left: 48%;
  opacity: 0.35;
  animation-delay: -7s;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(18px, -22px) scale(1.06); }
}

/* ---- Floating shell ---- */
.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.panel {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 28px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 20px 50px rgba(15, 23, 42, 0.08),
    0 4px 16px rgba(3, 127, 56, 0.06);
  overflow: hidden;
}

/* ---- Header ---- */
.panel-head {
  text-align: center;
  padding: 28px 22px 18px;
  background:
    linear-gradient(180deg, rgba(240, 253, 244, 0.9) 0%, rgba(255, 255, 255, 0) 100%);
}

.brand-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  /* لوگو بدون کارت/حاشیه‌ی سفید: خودِ آیکون کل قاب را پر می‌کند (سایه روی شکل لوگو، نه جعبه‌ی دورش) */
  background: none;
  display: grid;
  place-items: center;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(3, 127, 56, 0.28));
}

.panel-head h1 {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #014722;
  line-height: 1.35;
}

.panel-head p {
  margin-top: 6px;
  font-size: 0.86rem;
  color: #64748b;
  font-weight: 500;
}

/* ---- Body ---- */
.panel-body {
  padding: 6px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 2px 6px;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
}

.section-label::before,
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

/* ---- Role buttons ---- */
.role-btn {
  appearance: none;
  border: 1.5px solid #e8eef5;
  background: #fff;
  border-radius: 18px;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: right;
  cursor: pointer;
  font-family: inherit;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.role-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.role-btn:active {
  transform: scale(0.985);
}

.role-ico {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.role-btn:hover .role-ico {
  transform: scale(1.05);
}

.role-admin .role-ico {
  background: linear-gradient(145deg, #ede9fe, #ddd6fe);
  color: #6d28d9;
}

.role-teacher .role-ico {
  background: linear-gradient(145deg, #dcfce7, #bbf7d0);
  color: #046a2c;
}

.role-student .role-ico {
  background: linear-gradient(145deg, #fef3c7, #fde68a);
  color: #b45309;
}

.role-admin:hover {
  border-color: #c4b5fd;
  background: linear-gradient(90deg, #faf5ff 0%, #fff 60%);
}

.role-teacher:hover {
  border-color: #86efac;
  background: linear-gradient(90deg, #f0fdf4 0%, #fff 60%);
}

.role-student:hover {
  border-color: #fcd34d;
  background: linear-gradient(90deg, #fffbeb 0%, #fff 60%);
}

.role-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.role-txt strong {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
}

.role-txt small {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
  line-height: 1.4;
}

.role-go {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: 0.2s ease;
}

.role-btn:hover .role-go {
  background: #037f38;
  color: #fff;
}

/* ---- Footer ---- */
.panel-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 12px 16px 18px;
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

.panel-foot .dot {
  opacity: 0.5;
}

/* ---- Mobile ---- */
@media (max-width: 420px) {
  body.page-role-selection {
    padding: 16px 14px;
  }

  .panel {
    border-radius: 24px;
  }

  .panel-head {
    padding: 22px 16px 14px;
  }

  .panel-head h1 {
    font-size: 1.15rem;
  }

  .brand-mark {
    width: 64px;
    height: 64px;
  }

  .panel-body {
    padding: 4px 14px 14px;
  }

  .role-btn {
    padding: 12px;
    border-radius: 16px;
  }

  .role-ico {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }
}

@media (min-width: 640px) {
  .shell {
    max-width: 420px;
  }
}

/* کاهش حرکت برای accessibility */
@media (prefers-reduced-motion: reduce) {
  .blob,
  .shell,
  .role-btn {
    animation: none !important;
    transition: none !important;
  }
}
