/* Auth Modal Shared Styles */
:root {
  --primary-color: #00bcd4;
  --secondary-color: #00acc1;
  --accent-color: #e74c3c;
  --light-gray: #f8f9fa;
  --medium-gray: #e9ecef;
  --dark-gray: #6c757d;
  --text-color: #2c3e50;
  --border-color: #e8ecef;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;
  --dark-color: #0a2540;
  --navy-color: #0d3b66;
}

.hidden { display: none !important; }

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 64, 0.55);
  backdrop-filter: blur(4px);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.auth-modal {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  direction: rtl;
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
}

.auth-modal-close {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--dark-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-close:hover { border-color: rgba(0, 188, 212, 0.5); }

.auth-modal-header {
  padding: 0.95rem 1.1rem 0.8rem;
  background: linear-gradient(135deg, var(--dark-color), var(--navy-color));
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.auth-modal-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, var(--primary-color) 100%);
  opacity: 0.12;
}

.auth-modal-header > * { position: relative; z-index: 1; }

.auth-modal-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-modal-icon i { font-size: 1.4rem; }

.auth-modal-header-text h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.auth-modal-header-text p {
  margin: 0.25rem 0 0;
  opacity: 0.92;
  font-size: 0.95rem;
  font-weight: 500;
}

.auth-modal-body {
  padding: 0.85rem 1.1rem 0.95rem;
  display: grid;
  gap: 0.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-field label {
  display: block;
  font-weight: 800;
  color: var(--dark-color);
  margin-bottom: 0.22rem;
}

.auth-field .req { color: #e74c3c; }

.auth-field input {
  width: 100%;
  padding: 0.68rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  outline: none;
  font-size: 1rem;
  font-family: inherit;
}

.auth-field input:focus {
  border-color: rgba(0, 188, 212, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 188, 212, 0.12);
}

.auth-input-with-icon { position: relative; }
.auth-input-with-icon i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #25D366;
  font-size: 1.1rem;
}
.auth-input-with-icon input { padding-right: 44px; }

.auth-input-with-toggle { position: relative; }
.auth-input-with-toggle input { padding-left: 44px; }

.auth-toggle {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--dark-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-toggle:hover { border-color: rgba(0, 188, 212, 0.45); }
.auth-toggle i { font-size: 1rem; }

.auth-hint {
  margin: 0.15rem 0 0;
  color: #6c7a89;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.35;
}

.auth-error {
  display: block;
  min-height: 14px;
  margin-top: 0.15rem;
  color: #e74c3c;
  font-weight: 700;
  font-size: 0.82rem;
}

.auth-primary {
  width: 100%;
  padding: 0.78rem 1.05rem;
  border-radius: 999px;
  border: none;
  background: var(--navy-color);
  color: #fff;
  font-weight: 900;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.auth-primary:hover { background: var(--dark-color); }

.auth-switch {
  margin: 0.2rem 0 0;
  text-align: center;
  color: #7f8c8d;
  font-weight: 700;
}

.auth-link {
  background: none;
  border: none;
  padding: 0;
  margin-right: 6px;
  color: var(--primary-color);
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
}
.auth-link:hover { color: var(--secondary-color); }

.auth-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #7f8c8d;
  font-weight: 800;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  height: 1px;
  background: var(--border-color);
  flex: 1;
}
.auth-divider span { padding: 0 6px; }

.auth-google {
  width: 100%;
  padding: 0.74rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--dark-color);
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow);
}
.auth-google i { color: #DB4437; font-size: 1.1rem; }
.auth-google:hover { border-color: rgba(0, 188, 212, 0.45); }

@media (max-width: 480px){
  .auth-modal-backdrop { padding: 12px; }
  .auth-modal-header { padding: 0.9rem 0.95rem 0.75rem; }
  .auth-modal-body { padding: 0.8rem 0.95rem 0.95rem; }
}
