/* ============================================================
   منصة الصقر الجريء — Authentication Page Styles
   ============================================================ */

/* ── Auth Page Layout & Container ── */
.auth-body {
  min-height: 100vh;
  background-color: var(--navy-950);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(201, 168, 76, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(45, 212, 191, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(15, 32, 68, 0.8) 0%, transparent 70%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--color-text);
}

/* Background Animated Canvas / Particles container */
.auth-bg-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.auth-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: floatOrb 14s infinite ease-in-out alternate;
}

.auth-glow-orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--gold-400), transparent 70%);
  top: -100px;
  right: -100px;
}

.auth-glow-orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--navy-500), transparent 70%);
  bottom: -150px;
  left: -100px;
  animation-delay: -5s;
}

.auth-glow-orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-teal), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.15;
  animation-duration: 20s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 40px) scale(1.08); }
  100% { transform: translate(-20px, -30px) scale(0.95); }
}

/* Grid pattern overlay */
.auth-bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(201, 168, 76, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Top Header Navbar for Auth ── */
.auth-header {
  position: relative;
  z-index: 10;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--white);
  transition: transform 0.3s ease;
}

.auth-brand:hover {
  transform: translateY(-2px);
}

.auth-brand-logo {
  width: 44px;
  height: 44px;
  background: var(--grad-gold);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.35);
}

.auth-brand-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: var(--fw-bold);
  background: var(--grad-gold-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--white-70);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  transition: var(--transition-fast);
}

.auth-back-btn:hover {
  color: var(--gold-300);
  border-color: var(--gold-400);
  background: rgba(201, 168, 76, 0.1);
  transform: translateX(4px);
}

/* ── Main Container ── */
.auth-main {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  flex: 1;
}

.auth-wrapper {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Auth Card ── */
.auth-card {
  background: rgba(10, 22, 40, 0.78);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.65),
    0 0 30px rgba(201, 168, 76, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  padding: 2.5rem 2.25rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.auth-card:hover {
  border-color: rgba(201, 168, 76, 0.4);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.75),
    0 0 40px rgba(201, 168, 76, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Glowing Top Line Accent */
.auth-card-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, transparent, var(--gold-300), var(--accent-teal), var(--gold-400), transparent);
  background-size: 200% 100%;
  animation: shimmerGradient 4s linear infinite;
}

@keyframes shimmerGradient {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Header Inside Card */
.auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-icon-badge {
  width: 68px;
  height: 68px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.25), rgba(15, 32, 68, 0.85));
  border: 1.5px solid rgba(201, 168, 76, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35), inset 0 0 15px rgba(201, 168, 76, 0.2);
  position: relative;
}

.auth-icon-badge::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px dashed rgba(201, 168, 76, 0.35);
  animation: spinSlow 20s linear infinite;
}

@keyframes spinSlow {
  100% { transform: rotate(360deg); }
}

.auth-card-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: var(--fw-bold);
  color: var(--white);
  margin-bottom: 0.5rem;
  line-height: var(--lh-tight);
}

.auth-card-subtitle {
  font-size: var(--text-sm);
  color: var(--white-70);
  line-height: var(--lh-normal);
}

/* ── Segmented Tab Control ── */
.auth-tabs-container {
  background: rgba(5, 13, 26, 0.75);
  padding: 5px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(201, 168, 76, 0.25);
  display: flex;
  position: relative;
  margin-bottom: 2.25rem;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.auth-tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  color: var(--white-70);
  background: none;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  z-index: 2;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-tab-btn.active {
  color: var(--navy-900);
}

.auth-tab-slider {
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: calc(50% - 5px);
  background: var(--grad-gold);
  border-radius: var(--radius-full);
  z-index: 1;
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.4);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-tabs-container[data-active="register"] .auth-tab-slider {
  transform: translateX(-100%);
}

.auth-tabs-container[data-active="login"] .auth-tab-slider {
  transform: translateX(0);
}

/* ── Forms Viewport ── */
.auth-forms-viewport {
  position: relative;
}

.auth-form {
  display: none;
  animation: fadeInForm 0.4s ease forwards;
}

.auth-form.active {
  display: block;
}

@keyframes fadeInForm {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Form Controls & Inputs ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 520px) {
  .form-grid-2col {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--gold-200);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-label-icon {
  font-size: 1.05rem;
}

.form-label-required {
  color: #EF4444;
  margin-right: 2px;
}

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

.input-field {
  width: 100%;
  height: 52px;
  padding: 0 2.75rem 0 1rem;
  background: rgba(15, 32, 68, 0.55);
  border: 1.5px solid rgba(201, 168, 76, 0.22);
  border-radius: var(--radius-lg);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--text-base);
  outline: none;
  transition: all 0.3s ease;
}

.input-field::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.9rem;
}

.input-field:focus {
  border-color: var(--gold-400);
  background: rgba(15, 32, 68, 0.9);
  box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.15), 0 4px 20px rgba(0, 0, 0, 0.3);
}

.input-field.error {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
  animation: shakeError 0.4s ease;
}

.input-field.valid {
  border-color: #10B981;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Phone input country prefix addon */
.phone-prefix-addon {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: var(--fw-bold);
  color: var(--gold-300);
  direction: ltr;
  padding-right: 8px;
  border-right: 1px solid rgba(201, 168, 76, 0.2);
  pointer-events: none;
}

.input-field.phone-input {
  padding-left: 75px;
}

/* Input leading icon */
.input-leading-icon {
  position: absolute;
  right: 14px;
  color: var(--gold-400);
  font-size: 1.15rem;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.input-field:focus + .input-leading-icon,
.input-wrapper:focus-within .input-leading-icon {
  opacity: 1;
}

/* Password Toggle Eye Button */
.password-toggle-btn {
  position: absolute;
  left: 12px;
  background: none;
  border: none;
  color: var(--white-50);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle-btn:hover {
  color: var(--gold-300);
  background: rgba(255, 255, 255, 0.08);
}

/* Form Helper Error Text */
.form-error-msg {
  font-size: 0.78rem;
  color: #F87171;
  display: none;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.form-error-msg.show {
  display: flex;
}

/* ── Custom Styled Select Box for Grade ── */
.custom-select-wrapper {
  position: relative;
}

.custom-select-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.custom-select-arrow {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-400);
  pointer-events: none;
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.custom-select-wrapper select:focus ~ .custom-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-wrapper select option {
  background-color: var(--navy-900);
  color: var(--white);
  padding: 12px;
}

/* ── Password Strength Bar ── */
.password-strength-container {
  margin-top: 4px;
}

.password-strength-bar-bg {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  gap: 3px;
}

.password-strength-segment {
  height: 100%;
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s ease;
}

.password-strength-segment.active-weak { background: #EF4444; }
.password-strength-segment.active-medium { background: #F59E0B; }
.password-strength-segment.active-strong { background: #10B981; }

.password-hint-text {
  font-size: 0.75rem;
  color: var(--white-50);
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.password-rule-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  color: var(--white-70);
  transition: all 0.3s ease;
}

.password-rule-pill.valid {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

/* ── Checkbox & Links Row ── */
.form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.custom-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--text-sm);
  color: var(--white-70);
  cursor: pointer;
  user-select: none;
}

.custom-checkbox-input {
  display: none;
}

.custom-checkbox-box {
  width: 20px;
  height: 20px;
  border: 1.5px solid rgba(201, 168, 76, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(15, 32, 68, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-900);
  font-size: 0.75rem;
  font-weight: bold;
  transition: all 0.2s ease;
}

.custom-checkbox-input:checked + .custom-checkbox-box {
  background: var(--grad-gold);
  border-color: var(--gold-400);
  box-shadow: 0 0 10px rgba(201, 168, 76, 0.4);
}

.forgot-password-link {
  font-size: var(--text-sm);
  color: var(--gold-300);
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-password-link:hover {
  color: var(--gold-200);
  text-decoration: underline;
}

/* ── Submit Button ── */
.auth-submit-btn {
  width: 100%;
  height: 54px;
  margin-top: 1rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: var(--fw-bold);
  background: var(--grad-gold);
  color: var(--navy-900);
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 6px 25px rgba(201, 168, 76, 0.4);
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.auth-submit-btn:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 10px 35px rgba(201, 168, 76, 0.6);
}

.auth-submit-btn:active {
  transform: translateY(0) scale(0.98);
}

.auth-submit-btn .spinner {
  display: none;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(5, 13, 26, 0.3);
  border-top-color: var(--navy-900);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.auth-submit-btn.loading .btn-text,
.auth-submit-btn.loading .btn-arrow {
  display: none;
}

.auth-submit-btn.loading .spinner {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Footer Inside Card ── */
.auth-card-footer {
  margin-top: 1.75rem;
  text-align: center;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: var(--text-sm);
  color: var(--white-70);
}

.auth-switch-link {
  color: var(--gold-300);
  font-weight: var(--fw-bold);
  cursor: pointer;
  text-decoration: none;
  margin-right: 4px;
}

.auth-switch-link:hover {
  color: var(--gold-200);
  text-decoration: underline;
}

/* ── Footer copyright ── */
.auth-page-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.825rem;
  color: var(--white-50);
}

/* ── Success Modal Popup ── */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 16, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.auth-modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal-box {
  background: linear-gradient(145deg, var(--navy-800), var(--navy-900));
  border: 1.5px solid var(--gold-400);
  border-radius: var(--radius-2xl);
  padding: 2.5rem 2rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-gold), 0 20px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.8) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-modal-backdrop.show .auth-modal-box {
  transform: scale(1) translateY(0);
}

.auth-modal-icon {
  width: 80px;
  height: 80px;
  background: var(--grad-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 30px rgba(201, 168, 76, 0.5);
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); box-shadow: 0 10px 30px rgba(201, 168, 76, 0.5); }
  50% { transform: scale(1.05); box-shadow: 0 15px 40px rgba(201, 168, 76, 0.8); }
}

.auth-modal-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: var(--fw-bold);
  color: var(--white);
  margin-bottom: 0.75rem;
}

.auth-modal-desc {
  font-size: var(--text-base);
  color: var(--white-70);
  margin-bottom: 1.75rem;
  line-height: var(--lh-normal);
}

.auth-modal-btn {
  width: 100%;
}

/* Responsive tweaks */
@media (max-width: 576px) {
  .auth-card {
    padding: 1.75rem 1.25rem;
  }
  .auth-header {
    padding: 1rem;
  }
  .auth-card-title {
    font-size: 1.45rem;
  }
}
