/* ========== Theme System ========== */
:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --hover-bg: #fff7ed;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

body.dark {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --hover-bg: rgba(255, 107, 0, 0.1);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4);
}

* {
  font-family: "Vazirmatn FD NL", "Vazirmatn", system-ui, sans-serif;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(255, 107, 0, 0.4);
  }

  50% {
    box-shadow:
      0 0 25px rgba(255, 107, 0, 0.8),
      0 0 15px rgba(232, 62, 140, 0.5);
  }
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

@keyframes checkmark {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

.spin-slow {
  animation: spin-slow 20s linear infinite;
}

.float-animation {
  animation: float 4s ease-in-out infinite;
}

.theme-transition {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* Form Styles */
.form-input {
  transition: all 0.3s ease;
  background-color: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.form-input:focus {
  outline: none;
  border-color: #ff6b00;
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.form-input.error {
  border-color: #ef4444;
  animation: shake 0.3s ease-in-out;
}

.form-input.success {
  border-color: #22c55e;
}

/* Tab Switcher */
.tab-btn {
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.tab-btn.active {
  color: #ff6b00;
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ff6b00, #e83e8c);
  border-radius: 3px 3px 0 0;
  animation: slideInRight 0.3s ease-out;
}

/* Form Panels */
.form-panel-container {
  position: relative;
  min-height: 580px;
}

.form-panel {
  transition:
    opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
}

.form-panel.hidden-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.95);
}

.form-panel.visible-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  position: relative;
  transform: scale(1);
  animation: fadeInScale 0.5s cubic-bezier(0.2, 0.9, 0.4, 1.1) forwards;
}

/* Form Group Animations */
.form-group-item {
  opacity: 0;
  transform: translateX(15px);
}

.form-panel.visible-panel .form-group-item {
  animation: slideInRight 0.5s cubic-bezier(0.2, 0.9, 0.4, 1.1) forwards;
}

.form-panel.visible-panel .form-group-item:nth-child(1) {
  animation-delay: 0.05s;
}

.form-panel.visible-panel .form-group-item:nth-child(2) {
  animation-delay: 0.1s;
}

.form-panel.visible-panel .form-group-item:nth-child(3) {
  animation-delay: 0.15s;
}

.form-panel.visible-panel .form-group-item:nth-child(4) {
  animation-delay: 0.2s;
}

.form-panel.visible-panel .form-group-item:nth-child(5) {
  animation-delay: 0.25s;
}

.form-panel.visible-panel .form-group-item:nth-child(6) {
  animation-delay: 0.3s;
}

.form-panel.visible-panel .form-group-item:nth-child(7) {
  animation-delay: 0.35s;
}

.form-panel.visible-panel .form-group-item:nth-child(8) {
  animation-delay: 0.4s;
}

/* Password Strength */
.strength-container {
  margin-top: 0.5rem;
}

.strength-bar {
  height: 4px;
  border-radius: 4px;
  transition: all 0.3s ease;
  width: 0;
}

.strength-bar.weak {
  width: 33%;
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.strength-bar.medium {
  width: 66%;
  background: linear-gradient(90deg, #f59e0b, #eab308);
}

.strength-bar.strong {
  width: 100%;
  background: linear-gradient(90deg, #22c55e, #10b981);
}

.strength-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
  font-size: 0.7rem;
}

.strength-text.weak {
  color: #ef4444;
}

.strength-text.medium {
  color: #f59e0b;
}

.strength-text.strong {
  color: #22c55e;
}

.strength-suggestions {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: var(--bg-primary);
  border-radius: 0.5rem;
  display: none;
}

.strength-suggestions.show {
  display: block;
  animation: slideInRight 0.3s ease-out;
}

/* Error Message */
.field-error {
  font-size: 0.65rem;
  color: #ef4444;
  margin-top: 0.25rem;
  display: none;
}

.field-error.show {
  display: block;
}

/* Loading Spinner */
.btn-loading .btn-text {
  display: none;
}

.btn-loading .spinner {
  display: inline-block;
}

.spinner {
  display: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin-slow 0.6s linear infinite;
}

/* Submit Button */
.submit-btn {
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.submit-btn:hover::before {
  left: 100%;
}

.submit-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 25px -5px rgba(255, 107, 0, 0.4);
}

/* Social Button */
.social-btn {
  transition: all 0.25s ease;
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Remember Me Checkbox */
.checkbox-custom {
  appearance: none;
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid var(--border-color);
  border-radius: 0.3rem;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.checkbox-custom:checked {
  background: linear-gradient(135deg, #ff6b00, #e83e8c);
  border-color: transparent;
}

.checkbox-custom:checked::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.7rem;
  animation: checkmark 0.3s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--border-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #ff6b00, #e83e8c);
  border-radius: 10px;
}

button,
.tab-btn,
a,
.toggle-password,
.social-btn,
[role="button"] {
  cursor: pointer;
}

/* Welcome Message */
.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(
    135deg,
    rgba(255, 107, 0, 0.1),
    rgba(232, 62, 140, 0.1)
  );
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  margin-bottom: 1rem;
}

/* ========== Responsive Action Buttons ========== */
.action-buttons-wrapper {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 50;
}

.action-buttons-wrapper > div {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border-radius: 60px !important;
  padding: 6px 12px !important;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset,
    0 0 0 2px rgba(255, 255, 255, 0.1) inset !important;
  gap: 8px;
  transition: all 0.3s ease;
}

.action-buttons-wrapper > div:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
}

body.dark .action-buttons-wrapper > div {
  background: rgba(0, 0, 0, 0.3) !important;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset,
    0 0 0 2px rgba(255, 255, 255, 0.05) inset !important;
}

body.dark .action-buttons-wrapper > div:hover {
  background: rgba(0, 0, 0, 0.45) !important;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset !important;
}

.action-buttons-wrapper .action-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(4px) !important;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset !important;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1) !important;
}

.action-buttons-wrapper .action-btn:hover {
  transform: scale(1.1) translateY(-2px) !important;
  background: white !important;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 107, 0, 0.6) inset !important;
}

.action-buttons-wrapper .action-btn:active {
  transform: scale(0.95) !important;
}

/* حالت دارک مود دکمه‌ها در دسکتاپ */
body.dark .action-buttons-wrapper .action-btn {
  background: rgba(255, 255, 255, 0.2) !important;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset !important;
}

body.dark .action-buttons-wrapper .action-btn:hover {
  background: rgba(255, 255, 255, 0.35) !important;
  transform: scale(1.1) translateY(-2px) !important;
}

.action-buttons-wrapper .action-btn i {
  font-size: 1rem !important;
  color: #334155 !important;
  transition: all 0.3s ease !important;
}

.action-buttons-wrapper .action-btn:hover i {
  color: #ff6b00 !important;
  transform: scale(1.15) !important;
}

body.dark .action-buttons-wrapper .action-btn i {
  color: #e2e8f0 !important;
}

body.dark .action-buttons-wrapper .action-btn:hover i {
  color: #ff6b00 !important;
}

@media (max-width: 768px) {
  .action-buttons-wrapper {
    position: fixed !important;
    top: auto !important;
    left: auto !important;
    bottom: 25px;
    left: 50% !important;
    transform: translateX(-50%);
    z-index: 50;
    width: auto;
  }

  .action-buttons-wrapper > div {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    padding: 10px 20px !important;
    gap: 15px;
  }

  .action-buttons-wrapper .action-btn {
    width: 52px !important;
    height: 52px !important;
    background: rgba(255, 255, 255, 0.7) !important;
  }

  .action-buttons-wrapper .action-btn i {
    font-size: 1.3rem !important;
  }

  main {
    padding-bottom: 100px !important;
  }
}

@media (max-width: 480px) {
  .action-buttons-wrapper {
    bottom: 15px;
  }

  .action-buttons-wrapper > div {
    padding: 8px 16px !important;
    gap: 12px;
  }

  .action-buttons-wrapper .action-btn {
    width: 46px !important;
    height: 46px !important;
  }

  .action-buttons-wrapper .action-btn i {
    font-size: 1.1rem !important;
  }

  main {
    padding-bottom: 90px !important;
  }
}
