/**
 * Metronic RTL - Login Page Stylesheet (Compact & Refined Edition)
 * 100% Offline, Zero-CDN, Eye-Pleasing Blue Palette Matching index.html
 */

@font-face {
  font-family: 'IRANSans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/IRANSansWeb_Light.woff2') format('woff2'),
       url('../fonts/IRANSansWeb_Light.woff') format('woff'),
       url('../fonts/IRANSansWeb_Light.ttf') format('truetype');
}

@font-face {
  font-family: 'IRANSans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/IRANSansWeb_Light.woff2') format('woff2'),
       url('../fonts/IRANSansWeb_Light.woff') format('woff'),
       url('../fonts/IRANSansWeb_Light.ttf') format('truetype');
}

@font-face {
  font-family: 'IRANSans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/IRANSansWeb_Bold.woff2') format('woff2'),
       url('../fonts/IRANSansWeb_Bold.woff') format('woff'),
       url('../fonts/IRANSansWeb_Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'IRANSans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/IRANSansWeb_Bold.woff2') format('woff2'),
       url('../fonts/IRANSansWeb_Bold.woff') format('woff'),
       url('../fonts/IRANSansWeb_Bold.ttf') format('truetype');
}

:root {
  --primary-blue: #2563eb;
  --primary-blue-hover: #1d4ed8;
  --primary-blue-light: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.35);

  --header-bg-start: #142850;
  --header-bg-end: #1e4bb3;

  --accent-amber: #f59e0b;

  --text-dark: #181c32;
  --text-body: #475569;
  --text-muted: #94a3b8;

  --bg-page: #edf2f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 18px;
}

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

body {
  font-family: 'IRANSans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif !important;
  background-color: var(--bg-page);
  color: var(--text-body);
  direction: rtl;
  text-align: right;
  letter-spacing: 0 !important;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

body.login-page,
.login-page-body {
  padding: 1.25rem 1rem;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Background Decorative Elements (Subtle & Compact)
   -------------------------------------------------------------------------- */
.bg-decor-circle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.bg-decor-circle-1 {
  width: 100px;
  height: 100px;
  top: 10%;
  right: calc(50% + 370px);
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  opacity: 0.75;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
}

.bg-decor-circle-2 {
  width: 90px;
  height: 90px;
  bottom: 8%;
  left: calc(50% + 360px);
  background: linear-gradient(135deg, #ffffff, #dbeafe);
  opacity: 0.85;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
}

@media (max-width: 1024px) {
  .bg-decor-circle-1 {
    right: 2%;
    top: 4%;
    width: 70px;
    height: 70px;
  }
  .bg-decor-circle-2 {
    left: 2%;
    bottom: 4%;
    width: 70px;
    height: 70px;
  }
}

/* --------------------------------------------------------------------------
   Main Container & Card (Refined & Compact Dimensions)
   -------------------------------------------------------------------------- */
.login-container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0;
  position: relative;
  z-index: 10;
}

.login-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 45px -10px rgba(20, 40, 80, 0.14);
  display: flex;
  overflow: hidden;
  min-height: 430px;
  position: relative;
  border: 1px solid rgba(226, 232, 240, 0.85);
}

/* --------------------------------------------------------------------------
   Form Side (Right in RTL, White background)
   -------------------------------------------------------------------------- */
.login-form-side {
  flex: 1.15;
  padding: 2.2rem 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #ffffff;
}

.login-header-group {
  text-align: center;
  margin-bottom: 1.35rem;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
  letter-spacing: -0.3px;
}

.login-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* Form Inputs with Custom Rounded Style */
.form-group {
  margin-bottom: 0.85rem;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.3rem;
  display: block;
}

.custom-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.custom-input-group .input-icon {
  position: absolute;
  right: 0.85rem;
  color: #94a3b8;
  font-size: 0.88rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.custom-input {
  width: 100%;
  background-color: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.52rem 2.4rem 0.52rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-dark);
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.custom-input:focus {
  background-color: #ffffff;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.custom-input:focus ~ .input-icon,
.custom-input-group:focus-within .input-icon {
  color: var(--primary-blue);
}

.btn-toggle-password {
  position: absolute;
  left: 0.75rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.88rem;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-toggle-password:hover {
  color: var(--primary-blue);
}

/* Checkbox & Forgot Password */
.form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.35rem;
  margin-bottom: 1.15rem;
}

.custom-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.78rem;
  color: #475569;
  user-select: none;
}

.custom-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--primary-blue);
  cursor: pointer;
  border-radius: 4px;
}

.forgot-link {
  color: var(--primary-blue);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.forgot-link:hover {
  color: var(--primary-blue-hover);
  text-decoration: underline;
}

/* Submit Button */
.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-hover) 100%);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.62rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-login:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
  color: #ffffff;
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login .btn-icon {
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.btn-login:hover .btn-icon {
  transform: translateX(-3px);
}

/* Alert Notification */
.login-alert {
  display: none;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  align-items: center;
  gap: 0.5rem;
}

.login-alert.alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.login-alert.alert-success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* Form Footer Links */
.login-bottom-links {
  text-align: center;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-color);
}

.back-dashboard-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.back-dashboard-btn:hover {
  color: var(--primary-blue);
  background-color: #ffffff;
  border-color: var(--primary-blue);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Hero Side (Left in RTL, Eye-Pleasing Blue Gradient with Illustration)
   -------------------------------------------------------------------------- */
.login-hero-side {
  flex: 1.05;
  background: linear-gradient(135deg, var(--header-bg-start) 0%, #1a3c7a 50%, var(--header-bg-end) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

/* Subtle Topographic Curve Waves (SVG Background) */
.hero-wave-pattern {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.18;
}

/* Hero Wrapper to allow floating badge and popping person */
.hero-card-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 280px;
}

/* Glass Card Container (Matching Reference Image - Tall rounded frosted frame) */
.hero-glass-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 22px;
  box-shadow: 0 15px 35px -5px rgba(10, 20, 45, 0.35);
  z-index: 1;
}

/* Person image: Head comfortably inside, hand & tablet popping out to the left */
.hero-person-img {
  position: relative;
  z-index: 2;
  width: 275px;
  height: 275px;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  pointer-events: none;
  margin-right: -65px;
  filter: drop-shadow(0 10px 20px rgba(10, 20, 40, 0.35));
}

/* Floating Circular Lightning Badge (Positioned gracefully on outer left) */
.floating-lightning-badge {
  position: absolute;
  bottom: 18%;
  left: -16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--accent-amber);
  z-index: 10;
  animation: badgeFloat 3.5s ease-in-out infinite alternate;
}

@keyframes badgeFloat {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(-6px) rotate(4deg);
  }
}

/* Floating Glow Dot */
.hero-glow-dot {
  position: absolute;
  top: 16%;
  left: 14%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 12px 3px rgba(96, 165, 250, 0.6);
  z-index: 1;
}

/* Hero Caption on Top */
.hero-top-badge {
  position: absolute;
  top: 1.15rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  z-index: 4;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: 50rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-top-badge img {
  height: 14px;
  width: auto;
}

/* --------------------------------------------------------------------------
   Page Outer Footer (Matching Reference Image bottom credits)
   -------------------------------------------------------------------------- */
.login-outer-footer {
  width: 100%;
  max-width: 780px;
  margin: 0.85rem auto 0 auto;
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #64748b;
  font-size: 0.78rem;
  position: relative;
  z-index: 10;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  object-fit: cover;
}

.author-name {
  font-weight: 700;
  color: var(--text-dark);
  display: block;
  line-height: 1.2;
}

.author-role {
  font-size: 0.7rem;
  color: #94a3b8;
}

.footer-support-email {
  color: #64748b;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  direction: ltr;
  transition: color 0.2s;
}

.footer-support-email:hover {
  color: var(--primary-blue);
}

/* --------------------------------------------------------------------------
   Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
  }

  .login-card {
    flex-direction: column-reverse; /* Form comes first on mobile */
    min-height: auto;
  }

  .login-hero-side {
    padding: 2rem 1rem;
    min-height: 220px;
  }

  .hero-glass-card {
    width: 190px;
    height: 235px;
  }

  .floating-lightning-badge {
    bottom: 15%;
    left: -10px;
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .login-form-side {
    padding: 1.75rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 0;
  }

  .login-form-side {
    padding: 1.5rem 1rem;
  }

  .login-title {
    font-size: 1.25rem;
  }

  .form-options-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .login-outer-footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    justify-content: center;
  }

  .hero-glass-card {
    width: 170px;
    height: 210px;
  }

  .hero-top-badge {
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
  }
}
