/* login-style.css */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;600;700;900&display=swap');

:root {
  --bg:       #080c14;
  --card-bg:  rgba(13,18,30,.97);
  --border:   rgba(255,255,255,.08);
  --text:     #e8eaf0;
  --muted:    #8892a4;
  --blue:     #4f8ef7;
  --green:    #10b981;
  --orange:   #e85d2f;
  --yellow:   #f59e0b;
  --red:      #ef4444;
}

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

body {
  min-height: 100vh;
  background: var(--bg);
  font-family: 'Vazirmatn', sans-serif;
  direction: rtl;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ---- CANVAS ---- */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---- WRAP ---- */
.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- CARD ---- */
.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  animation: slideUp .5s ease;
}

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

/* ---- BRAND ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-ico {
  font-size: 2rem;
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--blue), #7c3aed);
  border-radius: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(79,142,247,.3);
  flex-shrink: 0;
}

.brand-name { font-size: 1.3rem; font-weight: 900; color: var(--text); }
.brand-sub  { font-size: .78rem; color: var(--muted); margin-top: 2px; }

/* ---- ROLE TABS ---- */
.role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 24px;
}

.role-tab {
  background: none;
  border: none;
  color: var(--muted);
  padding: 9px 4px;
  border-radius: 9px;
  font-family: 'Vazirmatn', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s;
  white-space: nowrap;
}

.role-tab:hover { color: var(--text); }

/* تب معلم — آبی */
.role-tab.active {
  background: linear-gradient(135deg, var(--blue), #6366f1);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79,142,247,.3);
}

/* تب مدیر — نارنجی */
.role-tab.admin-tab.active {
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  box-shadow: 0 4px 14px rgba(232,93,47,.3);
}

/* ---- FIELDS ---- */
.field-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 15px;
  margin-bottom: 11px;
  transition: border-color .2s;
}

.field-wrap:focus-within { border-color: var(--blue); }
.field-wrap:has(#adminUser):focus-within,
.field-wrap:has(#adminPass):focus-within { border-color: var(--orange); }

.field-ico { font-size: 1rem; flex-shrink: 0; }

.field-wrap input,
.field-wrap select {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'Vazirmatn', sans-serif;
  font-size: .92rem;
  direction: rtl;
  outline: none;
  appearance: none;
}

.field-wrap input::placeholder { color: rgba(136,146,164,.45); }
.field-wrap select { cursor: pointer; }
.field-wrap select option { background: #1a2235; }

.toggle-pass {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  padding: 2px;
  opacity: .6;
  transition: opacity .2s;
  flex-shrink: 0;
}
.toggle-pass:hover { opacity: 1; }

/* ---- BUTTONS ---- */
.login-btn {
  width: 100%;
  border: none;
  padding: 13px;
  border-radius: 12px;
  font-family: 'Vazirmatn', sans-serif;
  font-size: .97rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity .2s, transform .15s;
}

.login-btn:hover { opacity: .88; transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }

.teacher-btn { background: linear-gradient(135deg, var(--blue), #6366f1); }
.student-btn { background: linear-gradient(135deg, var(--green), var(--blue)); }
.admin-btn   { background: linear-gradient(135deg, var(--orange), var(--yellow)); }

/* ---- ADMIN NOTICE ---- */
.admin-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(232,93,47,.08);
  border: 1px solid rgba(232,93,47,.2);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: .84rem;
  color: #f59e0b;
  margin-bottom: 14px;
}

/* ---- ERROR ---- */
.error-box {
  margin-top: 12px;
  min-height: 20px;
  font-size: .85rem;
  color: var(--red);
  text-align: center;
  opacity: 0;
  transition: opacity .2s;
}
.error-box.show { opacity: 1; }

/* ---- LOADING OVERLAY ---- */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,12,20,.7);
  z-index: 999;
  place-items: center;
  backdrop-filter: blur(3px);
}
.loading-overlay.show { display: grid; }

.spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

/* ---- HIDDEN ---- */
.hidden { display: none; }

/* ---- SHAKE ---- */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}

@media (max-width: 480px) {
  .login-card { padding: 28px 20px; }
  .role-tab   { font-size: .75rem; }
}