/*
 * File: assets/css/login.css
 * Project: PHP License System
 * Description: (V7 - Final Animations) CSS for monkey hands and snowflake burst.
 * [MODIFIED] Replaced snowflake background with new JP Matrix effect.
 * [MODIFIED-V2] Fixed matrix position to cover viewport & changed red buttons to glassmorphism.
 */

body {
    font-family: 'IRANSans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #05050a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    direction: ltr;
    margin: 0;
    overflow: hidden;
    cursor: default;
}

/* --- [NEW] JP Matrix Background --- */
.jp-matrix {
  background-color: #05050a;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  grid-auto-rows: 40px;
  font-size: 32px;
  color: rgba(0, 150, 255, 0.4);
  font-family: "Courier New", Courier, monospace;
  justify-content: center;
  align-content: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
}

.jp-matrix > span {
  text-align: center;
  text-shadow: 0 0 5px rgba(0, 150, 255, 0.5);
  user-select: none;
  transition:
    color 0.5s,
    text-shadow 0.5s;
  line-height: 1;
}

.jp-matrix > span:nth-child(19n + 2) {
  animation: smooth-pulse 3.5s ease-in-out infinite 0.2s;
}
.jp-matrix > span:nth-child(29n + 1) {
  animation: smooth-pulse 4.1s ease-in-out infinite 0.7s;
}
.jp-matrix > span:nth-child(11n) {
  color: rgba(100, 200, 255, 0.7);
  animation: smooth-pulse 2.9s ease-in-out infinite 1.1s;
}
.jp-matrix > span:nth-child(37n + 10) {
  animation: smooth-pulse 5.3s ease-in-out infinite 1.5s;
}
.jp-matrix > span:nth-child(41n + 1) {
  animation: smooth-pulse 3.9s ease-in-out infinite 0.4s;
}
.jp-matrix > span:nth-child(17n + 9) {
  animation: smooth-pulse 2.8s ease-in-out infinite 0.9s;
}
.jp-matrix > span:nth-child(23n + 18) {
  animation: smooth-pulse 4.3s ease-in-out infinite 1.3s;
}
.jp-matrix > span:nth-child(31n + 4) {
  animation: smooth-pulse 5.6s ease-in-out infinite 0.1s;
}
.jp-matrix > span:nth-child(43n + 20) {
  animation: smooth-pulse 3.6s ease-in-out infinite 1.8s;
}
.jp-matrix > span:nth-child(13n + 6) {
  animation: smooth-pulse 3.2s ease-in-out infinite 1.2s;
}
.jp-matrix > span:nth-child(53n + 5) {
  animation: smooth-pulse 4.9s ease-in-out infinite 0.5s;
}
.jp-matrix > span:nth-child(47n + 15) {
  animation: smooth-pulse 5.9s ease-in-out infinite 1s;
}

@keyframes smooth-pulse {
  0%,
  100% {
    color: rgba(0, 150, 255, 0.4);
    text-shadow: 0 0 5px rgba(0, 150, 255, 0.5);
  }
  30% {
    color: rgba(100, 200, 255, 1);
    text-shadow:
      0 0 10px rgba(100, 200, 255, 1),
      0 0 15px rgba(100, 200, 255, 1);
  }
  50% {
    color: rgba(255, 105, 180, 1);
    text-shadow:
      0 0 10px rgba(255, 105, 180, 1),
      0 0 15px rgba(255, 105, 180, 1);
  }
  70% {
    color: #ffffff;
    text-shadow:
      0 0 10px #fff,
      0 0 15px #fff,
      0 0 20px #fff;
  }
}

/* --- استایل کارت شیشه‌ای (Glassmorphism) --- */
.card {
  --p: 32px;
  --h-form: auto;
  --w-form: 380px;
  --input-px: 0.75rem;
  --input-py: 0.65rem;
  --submit-h: 38px;
  --space-y: 0.5rem;
  
  width: var(--w-form);
  max-width: 100%;
  border-radius: 16px;
  
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  flex-direction: column;
  overflow: hidden;
  padding: var(--p);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
    "Lucida Sans", Arial, sans-serif;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  z-index: 10;
}

/* --- انیمیشن میمون (کامل) --- */
.avatar {
  --sz-avatar: 166px;
  order: 0;
  width: var(--sz-avatar);
  min-width: var(--sz-avatar);
  max-width: var(--sz-avatar);
  height: var(--sz-avatar);
  min-height: var(--sz-avatar);
  max-height: var(--sz-avatar);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 9999px;
  overflow: hidden;
  cursor: pointer;
  z-index: 2;
  perspective: 80px;
  position: relative;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  --sz-svg: calc(var(--sz-avatar) - 10px);
}
.avatar svg {
  position: absolute;
  transition:
    transform 0.2s ease-in,
    opacity 0.1s;
  transform-origin: 50% 100%;
  height: var(--sz-svg);
  width: var(--sz-svg);
  pointer-events: none;
}
.avatar svg#monkey { z-index: 1; }
.avatar svg#monkey-hands {
  z-index: 2;
  transform-style: preserve-3d;
  transform: translateY(calc(var(--sz-avatar) / 1.25)) rotateX(-21deg); /* حالت پیش‌فرض */
}
.avatar::before {
  content: "";
  border-radius: 45%;
  width: calc(var(--sz-svg) / 3.889);
  height: calc(var(--sz-svg) / 5.833);
  border: 0;
  border-bottom: calc(var(--sz-svg) * (4 / 100)) solid #3c302a;
  bottom: 20%;
  position: absolute;
  transition: all 0.2s ease;
  z-index: 3;
}
.avatar.blind-checked::before {
  width: calc(var(--sz-svg) * (9 / 100));
  height: 0;
  border-radius: 50%;
  border-bottom: calc(var(--sz-svg) * (10 / 100)) solid #3c302a;
}
.avatar svg#monkey .monkey-eye-r,
.avatar svg#monkey .monkey-eye-l {
  animation: blink 10s 1s infinite;
  transition: all 0.2s ease;
}
@keyframes blink {
  0%, 2%, 4%, 26%, 28%, 71%, 73%, 100% { ry: 4.5; cy: 31.7; }
  1%, 3%, 27%, 72% { ry: 0.5; cy: 30; }
}
.avatar.blind-checked svg#monkey .monkey-eye-r,
.avatar.blind-checked svg#monkey .monkey-eye-l {
  ry: 0.5;
  cy: 30;
  animation: none; /* پلک زدن را متوقف کن */
}
.avatar.blind-checked svg#monkey-hands {
  transform: translate3d(0, 0, 0) rotateX(0deg);
}
.avatar svg#monkey,
.avatar::before,
.avatar svg#monkey .monkey-eye-nose,
.avatar svg#monkey .monkey-eye-r,
.avatar svg#monkey .monkey-eye-l {
  transition: all 0.2s ease;
}

/* --- دکمه نمایش/پنهان --- */
.form .frg_pss .blind_input {
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
}
.form .frg_pss .blind_input:hover {
  background-color: rgba(255, 255, 255, 0.2);
}


/* --- فرم --- */
.form {
  order: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  flex-direction: column;
  width: 100%;
}

.form .title {
  width: 100%;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1rem;
  padding-top: 0;
  padding-bottom: 1rem;
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  text-align: center;
}

.form .label_input {
  white-space: nowrap;
  font-size: 1rem;
  margin-top: calc(var(--space-y) / 2);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  display: inline;
  text-align: left;
  margin-right: auto;
  position: relative;
  z-index: 99;
  -webkit-user-select: none;
  user-select: none;
}

/* --- ورودی‌های شیشه‌ای --- */
.form .input {
  resize: vertical;
  background: rgba(255, 255, 255, 0.1); 
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2); 
  border-radius: 6px;
  outline: none;
  padding: var(--input-py) var(--input-px);
  font-size: 18px;
  width: 100%;
  color: #fff; 
  margin: var(--space-y) 0;
  transition: all 0.25s ease;
}
.form .input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form .input#password-input {
  padding-right: var(--input-px); 
}

.form .input:focus {
  border: 1px solid rgba(0, 150, 255, 0.7); 
  outline: 0;
  box-shadow: 0 0 0 2px rgba(0, 150, 255, 0.2); 
}
.form .frg_pss {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between; 
  margin-top: var(--space-y);
}

/* --- دکمه ارسال (شیشه‌ای) --- */
.form .submit {
  height: var(--submit-h);
  width: 100%;
  outline: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  letter-spacing: 0.25px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  -webkit-appearance: button;
  appearance: button;
  margin: var(--space-y) 0 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.form .submit:hover {
  background-color: rgba(255, 255, 255, 0.2); 
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}


/* --- استایل اعلان خطای شناور --- */
.alert-container {
  position: fixed; 
  top: 20px;
  right: 20px;
  width: 320px;
  z-index: 2000; 
  opacity: 1;
}

.error-alert {
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  border-radius: 8px;
  background-color: #232531;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.alert-content {
  display: flex;
  gap: 8px;
  align-items: center;
}

.alert-icon {
  color: #d65563;
  background-color: rgba(255, 255,255, 0.05);
  backdrop-filter: blur(10px);
  padding: 4px;
  border-radius: 8px;
  flex-shrink: 0;
}
.alert-icon svg {
  width: 24px;
  height: 24px;
}

.alert-text {
  font-size: 0.9rem;
  text-align: left;
}
.alert-text .alert-title {
  color: white;
  font-weight: 600;
  margin: 0;
}
.alert-text .alert-description {
  color: #9ca3af;
  margin: 0;
  font-size: 0.8rem;
}

.alert-close-btn {
  color: #4b5563;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background-color 0.2s ease-in-out;
  align-self: flex-start;
}
.alert-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #9ca3af;
}
.alert-close-btn svg {
  width: 24px;
  height: 24px;
}