@font-face {
  font-family: 'Nastaliq';
  src: url('/fonts/IranNastaliq.ttf') format('truetype');
}

* {
  box-sizing: border-box;
  font-family: Vazirmatn, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #f5d97a;
  background: #000;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.55) inset !important;
  -webkit-text-fill-color: #fff8d6 !important;
  transition: background-color 5000s ease-in-out 0s;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.035), transparent 60%), #000;
}

.register-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 400px;
  height: 90%;
  padding: 35px;
  border-radius: 18px;
  background: #040404;
  overflow: hidden;
  z-index: 5;
  isolation: isolate;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.12), 0 0 35px rgba(255, 215, 0, 0.06), 0 0 70px rgba(0, 0, 0, 0.98);
  display: flex;
  flex-direction: column;
}

.register-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 335deg,
    rgba(255, 215, 0, 0.18) 345deg,
    rgba(255, 245, 210, 0.75) 352deg,
    #ffffff 357deg,
    #ffd700 360deg
  );
  animation: rotateRegisterBeam 4s linear infinite;
  z-index: -2;
  filter: blur(0.3px) drop-shadow(0 0 5px #ffffff) drop-shadow(0 0 12px #ffd700) drop-shadow(0 0 22px #ffaa00);
}

.register-card::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 21px;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.99) 0%, rgba(4, 4, 4, 0.99) 100%);
  border: 1px solid rgba(255, 215, 0, 0.18);
  z-index: -1;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.9), inset 0 0 25px rgba(0, 0, 0, 0.95);
}

@keyframes rotateRegisterBeam {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.card-header {
  margin-bottom: 2px;
  flex-shrink: 0;
}

.card-header h1 {
  color: #ffd700;
  font-size: 24px;
  font-weight: 500;
  font-family: 'Nastaliq';
  text-align: center;
  margin-bottom: 4px;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

.card-header p {
  margin: 0;
  color: #c8b979;
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
}

.form-wrapper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 5px;
  display: flex;
  flex-direction: column;
}

.form-wrapper::-webkit-scrollbar {
  width: 4px;
}

.form-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.form-wrapper::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: linear-gradient(#ffd700, #aa7400);
}

.form-step {
  display: none;
}

.form-step.active {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  color: #ead58a;
  font-size: 12px;
  font-weight: 500;
}

.field input,
.field select {
  height: 35px;
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 0, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: #fff8d6;
  padding: 0 12px;
  font-size: 12px;
  outline: none;
  transition: 0.2s ease;
}

.field select option {
  color: #f5d97a;
  background: #080808;
}

.field input::placeholder {
  color: rgba(245, 217, 122, 0.42);
}

.field input:focus,
.field select:focus {
  border-color: rgba(255, 215, 0, 0.72);
  background: rgba(255, 215, 0, 0.065);
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.10), 0 8px 24px rgba(255, 170, 0, 0.10), 0 0 14px rgba(255, 215, 0, 0.12);
}

.role-toggle-group {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 215, 0, 0.18);
  border-radius: 14px;
  padding: 3px;
  gap: 4px;
}

.role-btn {
  flex: 1;
  height: 30px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: #f5d97a;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
}

.role-btn.active {
  background: linear-gradient(135deg, #8f6500 0%, #ffd700 50%, #b8860b 100%);
  color: #080808;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
}

.error {
  min-height: 18px;
  color: #fca5a5;
  font-size: 11px;
}

.actions {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.btn {
  min-height: 35px;
  padding: 0 14px;
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: 14px;
  font-family: Vazirmatn, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #f8e9a9;
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.10), rgba(255, 215, 0, 0.035));
  cursor: pointer;
  transition: 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  color: #fff5c2;
  border-color: rgba(255, 215, 0, 0.58);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.16), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #8f6500 0%, #ffd700 50%, #b8860b 100%);
  color: #080808;
  border-color: rgba(255, 245, 180, 0.55);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: none;
}

.btn-primary:hover:not(:disabled) {
  color: #000;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.38), 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-success {
  background: linear-gradient(135deg, #8f6500 0%, #ffd700 50%, #b8860b 100%);
  color: #080808;
  border-color: rgba(255, 245, 180, 0.55);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.18);
}

.btn-success:hover:not(:disabled) {
  color: #000;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.35);
}

.btn:disabled {
  background: rgba(255, 255, 255, 0.055);
  color: rgba(245, 217, 122, 0.36);
  border-color: rgba(255, 215, 0, 0.10);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.card-footer {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 215, 0, 0.14);
  text-align: center;
  color: #a99455;
  font-size: 14px;
  flex-shrink: 0;
}

.card-footer a {
  color: #ffd700;
  text-decoration: none;
  font-weight: 500;
  margin-right: 5px;
  transition: 0.2s ease;
}

.card-footer a:hover {
  color: #fff2a8;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.45);
}

.global-message {
  margin-top: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 215, 0, 0.18);
  border-radius: 10px;
  color: #f5d97a;
  background: rgba(255, 215, 0, 0.07);
  font-size: 10px;
  text-align: center;
}

.hidden {
  display: none !important;
}

#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  position: relative;
  overflow: hidden;
  padding: 14px 18px;
  margin-bottom: 12px;
  border-radius: 18px;
  color: #fff8d6;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.2px;
  background: rgba(255, 215, 0, 0.10);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 215, 0, 0.28);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55), 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 18px rgba(255, 215, 0, 0.12), inset 0 1px 0 rgba(255, 245, 210, 0.22);
  animation: slideInDown 0.45s cubic-bezier(.22, 1, .36, 1), fadeOut 0.45s ease 3.1s forwards;
}

.toast::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 215, 0, 0.035));
  pointer-events: none;
}

.toast.success {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.28), rgba(180, 125, 0, 0.16));
  border-color: rgba(255, 225, 100, 0.42);
  box-shadow: 0 18px 40px rgba(255, 170, 0, 0.16), 0 0 18px rgba(255, 215, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.toast.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.30), rgba(127, 29, 29, 0.20));
  border-color: rgba(252, 165, 165, 0.30);
  box-shadow: 0 18px 40px rgba(220, 38, 38, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.toast.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.30), rgba(146, 89, 0, 0.20));
  border-color: rgba(253, 211, 77, 0.34);
  box-shadow: 0 18px 40px rgba(217, 119, 6, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.toast.info {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(161, 98, 7, 0.16));
  border-color: rgba(253, 224, 71, 0.30);
  box-shadow: 0 18px 40px rgba(180, 130, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

@media (max-width: 768px) {
  .register-card {
    width: 90%;
    max-width: 400px;
    height: 80%;
    padding: 20px;
    border-radius: 14px;
  }
}
