/* ==========================================================================
   BOXD - Retro Pixel Authentication Stylesheet (Login & Register)
   Light Background, Hard Pixel Drop Shadows, Deep Purple Accents (#9333ea)
   ========================================================================== */

.auth-wrapper {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  position: relative;
  background-color: var(--bg-main);
  background-image: radial-gradient(#9333ea18 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}

.auth-card {
  width: 100%;
  max-width: 500px;
  background: #ffffff;
  border: 2px solid #121214;
  box-shadow: 5px 5px 0px #121214;
  border-radius: var(--radius-sm);
  padding: 42px 36px;
  position: relative;
  z-index: 2;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-card:hover {
  transform: translateY(-2px);
  box-shadow: 7px 7px 0px #9333ea;
}

/* Header & Brand */
.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand-logo {
  height: 48px;
  object-fit: contain;
  margin: 0 auto 16px;
  display: block;
  filter: drop-shadow(2px 2px 0px rgba(18, 18, 20, 0.2));
}

.auth-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f3e8ff;
  border: 1.5px solid #9333ea;
  color: #9333ea;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 4px;
  box-shadow: 2px 2px 0px #9333ea;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 900;
  color: #121214;
  margin-bottom: 8px;
  line-height: 1.2;
}

.auth-subtitle {
  font-family: var(--font-body);
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Forms & Inputs */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #121214;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-input {
  width: 100%;
  padding: 13px 14px;
  background: #ffffff;
  border: 2px solid #121214;
  box-shadow: 2px 2px 0px #121214;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1.25rem;
  color: #121214;
  transition: all 0.15s ease;
}

.auth-input:focus {
  outline: none;
  border-color: #9333ea;
  box-shadow: 3px 3px 0px #9333ea;
  background: #faf5ff;
}

.auth-input::placeholder {
  color: #94a3b8;
  font-size: 1.15rem;
}

/* Password Toggle Eye Button */
.input-pw-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-pw-wrapper .auth-input {
  padding-right: 46px;
}

[dir="rtl"] .input-pw-wrapper .auth-input {
  padding-right: 14px;
  padding-left: 46px;
}

.btn-toggle-pw {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  z-index: 3;
}

[dir="rtl"] .btn-toggle-pw {
  right: auto;
  left: 10px;
}

.btn-toggle-pw:hover {
  color: #9333ea;
}

/* Password match indicator */
.pw-match-indicator {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 4px;
  display: none;
}

.pw-match-indicator.match {
  color: #10b981;
  display: block;
}

.pw-match-indicator.mismatch {
  color: #f43f5e;
  display: block;
}

/* Checkbox Row */
.auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.pixel-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.pixel-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border: 2px solid #121214;
  box-shadow: 1.5px 1.5px 0px #121214;
  border-radius: 3px;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: all 0.1s;
}

.pixel-checkbox:checked {
  background: #9333ea;
  border-color: #121214;
  box-shadow: 1.5px 1.5px 0px #9333ea;
}

.pixel-checkbox:checked::after {
  content: '✓';
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

/* Submit Action Button */
.btn-auth-submit {
  width: 100%;
  padding: 14px 20px;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  background: #9333ea;
  color: #ffffff;
  border: 2px solid #121214;
  box-shadow: 4px 4px 0px #121214;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-auth-submit:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #121214;
  background: #7e22ce;
}

.btn-auth-submit:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0px #121214;
}

.btn-auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Switch & Footer Link */
.auth-switch-link {
  text-align: center;
  margin-top: 22px;
  font-family: var(--font-body);
  font-size: 1.25rem;
  color: var(--text-muted);
}

.auth-switch-link a {
  color: #9333ea;
  font-weight: 800;
  text-decoration: underline;
  transition: color 0.15s;
}

.auth-switch-link a:hover {
  color: #7e22ce;
}

/* RTL Typography & Optical Font Sizing (Matches English Visual Scale) */
[dir="rtl"] .auth-card {
  text-align: right;
}

[dir="rtl"] .auth-tag-pill {
  font-size: 0.85rem;
  padding: 3px 10px;
}

[dir="rtl"] .auth-title {
  font-family: var(--font-ar), 'Changa', sans-serif !important;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0px !important;
  margin-bottom: 6px;
}

[dir="rtl"] .auth-subtitle {
  font-family: var(--font-ar), 'Changa', sans-serif !important;
  font-size: 0.95rem;
  line-height: 1.45;
  letter-spacing: 0px !important;
}

[dir="rtl"] .auth-label {
  flex-direction: row;
  font-size: 0.95rem;
  font-weight: 700;
  gap: 8px;
}

[dir="rtl"] .auth-input {
  font-size: 0.95rem;
  padding: 11px 14px;
}

[dir="rtl"] .auth-input::placeholder {
  font-size: 0.9rem;
}

[dir="rtl"] .auth-remember-row {
  font-size: 0.92rem;
}

[dir="rtl"] .pixel-checkbox-label {
  font-size: 0.92rem;
}

[dir="rtl"] .pw-match-indicator {
  font-size: 0.85rem;
}

[dir="rtl"] .btn-auth-submit {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 12px 18px;
}

[dir="rtl"] .auth-switch-link {
  font-family: var(--font-ar), 'Changa', sans-serif !important;
  font-size: 0.95rem;
  letter-spacing: 0px !important;
}

@media (max-width: 540px) {
  .auth-card {
    padding: 30px 20px;
  }
  .auth-title {
    font-size: 1.95rem;
  }
  [dir="rtl"] .auth-title {
    font-size: 1.35rem;
  }
}
