/* =========================================================================
   auth.css — أنماط نظام المصادقة والصفحات المرتبطة
   Styles for: preview page, login/register, admin panel, user controls
   ========================================================================= */

/* ============ USER CONTROLS (navbar) ============ */
.user-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  padding-left: 12px;
  flex-shrink: 0;
}
.user-name {
  color: #7dd3fc;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.user-admin-link {
  color: #00d4ff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid rgba(0, 212, 255, 0.3);
  transition: all 0.3s;
  white-space: nowrap;
}
.user-admin-link:hover {
  background: rgba(0, 212, 255, 0.22);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.3);
}
.btn-logout {
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 68, 102, 0.12);
  color: #ff8899;
  border: 1px solid rgba(255, 68, 102, 0.35);
  border-radius: 8px;
  transition: all 0.3s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-logout:hover {
  background: rgba(255, 68, 102, 0.22);
  box-shadow: 0 0 16px rgba(255, 68, 102, 0.3);
  transform: translateY(-1px);
}

/* ============ AUTH PAGES SHARED ============ */
.auth-body {
  font-family: 'Cairo', sans-serif;
  background: #000510;
  color: #fff;
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(0,170,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,170,255,0.04) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0%, rgba(0,102,204,0.10), transparent 50%);
  background-size: 50px 50px, 50px 50px, 100% 100%;
}
.auth-card {
  background: linear-gradient(160deg, rgba(0,30,60,0.7), rgba(0,10,25,0.5));
  border: 1px solid rgba(0,170,255,0.3);
  border-radius: 24px;
  padding: 44px 38px;
  max-width: 480px;
  width: 90%;
  margin: 40px auto;
  box-shadow: 0 0 60px rgba(0,102,204,0.2), inset 0 0 40px rgba(0,102,204,0.05);
  backdrop-filter: blur(20px);
  position: relative;
  text-align: center;
  animation: fadeIn 0.6s ease;
}
.auth-card.wide {
  max-width: 720px;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-logo {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 0 12px rgba(0,212,255,0.4));
  margin-bottom: 12px;
}
.auth-title {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(0,212,255,0.3);
}
.auth-subtitle {
  color: #7dd3fc;
  font-size: 0.85rem;
  margin-bottom: 28px;
  font-weight: 600;
}
.auth-field {
  position: relative;
  margin-bottom: 18px;
  text-align: right;
}
.auth-field label {
  display: block;
  color: #aabbcc;
  font-size: 0.85rem;
  margin-bottom: 7px;
  font-weight: 600;
}
.auth-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(0,5,16,0.8);
  border: 2px solid rgba(0,170,255,0.25);
  border-radius: 12px;
  color: #fff;
  outline: none;
  transition: all 0.3s;
  text-align: right;
}
.auth-input:focus {
  border-color: #00d4ff;
  box-shadow: 0 0 20px rgba(0,212,255,0.3);
}
.auth-input::placeholder {
  color: #445566;
}
.auth-btn {
  width: 100%;
  padding: 15px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, #00aaff, #00d4ff);
  color: #001a33;
  border: none;
  border-radius: 12px;
  transition: all 0.3s;
  box-shadow: 0 0 30px rgba(0,212,255,0.3);
  font-family: inherit;
  margin-top: 6px;
}
.auth-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(0,212,255,0.5);
}
.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.auth-btn.secondary {
  background: transparent;
  color: #7dd3fc;
  border: 2px solid rgba(0,170,255,0.4);
  box-shadow: none;
}
.auth-btn.secondary:hover:not(:disabled) {
  background: rgba(0,170,255,0.1);
  border-color: #00d4ff;
  box-shadow: 0 0 20px rgba(0,212,255,0.2);
}
.auth-msg {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  display: none;
}
.auth-msg.show {
  display: block;
  animation: fadeIn 0.3s;
}
.auth-msg.error {
  background: rgba(255,68,102,0.15);
  border: 1px solid rgba(255,68,102,0.4);
  color: #ff8899;
}
.auth-msg.ok {
  background: rgba(0,255,136,0.1);
  border: 1px solid rgba(0,255,136,0.3);
  color: #66ffaa;
}
.auth-msg.info {
  background: rgba(0,170,255,0.1);
  border: 1px solid rgba(0,170,255,0.3);
  color: #7dd3fc;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: rgba(0,5,16,0.6);
  border-radius: 12px;
  padding: 5px;
}
.auth-tab {
  flex: 1;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #667788;
  border-radius: 9px;
  transition: all 0.3s;
  font-family: inherit;
}
.auth-tab.active {
  background: linear-gradient(135deg, #00aaff, #00d4ff);
  color: #001a33;
  box-shadow: 0 0 20px rgba(0,212,255,0.3);
}
.auth-footer-link {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(0,170,255,0.15);
  font-size: 0.85rem;
  color: #667788;
}
.auth-footer-link a {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 600;
}
.auth-footer-link a:hover {
  text-decoration: underline;
}

/* ============ PREVIEW PAGE ============ */
.preview-body {
  font-family: 'Cairo', sans-serif;
  background: #000510;
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    linear-gradient(rgba(0,170,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,170,255,0.04) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0%, rgba(0,102,204,0.12), transparent 50%);
  background-size: 50px 50px, 50px 50px, 100% 100%;
}
.preview-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(0,5,16,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,170,255,0.15);
}
.preview-nav .logo-text {
  font-weight: 900;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.preview-nav .logo-text .fr {
  color: #7dd3fc;
  font-size: 0.85rem;
}
.preview-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 24px 60px;
  position: relative;
}
.preview-hero h1 {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 16px;
  text-shadow: 0 0 40px rgba(0,212,255,0.3);
  max-width: 800px;
}
.preview-hero h1 .accent {
  color: #00d4ff;
}
.preview-hero p {
  font-size: 1.15rem;
  color: #aabbcc;
  max-width: 650px;
  line-height: 1.8;
  margin-bottom: 36px;
}
.preview-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.preview-cta .btn {
  padding: 16px 38px;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  font-family: inherit;
  border: none;
  cursor: pointer;
}
.preview-cta .btn-primary {
  background: linear-gradient(135deg, #00aaff, #00d4ff);
  color: #001a33;
  box-shadow: 0 0 40px rgba(0,212,255,0.4);
}
.preview-cta .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 50px rgba(0,212,255,0.6);
}
.preview-cta .btn-outline {
  background: transparent;
  color: #7dd3fc;
  border: 2px solid rgba(0,170,255,0.4);
}
.preview-cta .btn-outline:hover {
  background: rgba(0,170,255,0.1);
  border-color: #00d4ff;
}
.preview-stats {
  display: flex;
  gap: 48px;
  margin-top: 60px;
  flex-wrap: wrap;
  justify-content: center;
}
.preview-stat {
  text-align: center;
}
.preview-stat .num {
  font-size: 2.5rem;
  font-weight: 900;
  color: #00d4ff;
  text-shadow: 0 0 20px rgba(0,212,255,0.4);
}
.preview-stat .label {
  font-size: 0.9rem;
  color: #8899aa;
  font-weight: 600;
  margin-top: 4px;
}

/* ============ FEATURES SECTION ============ */
.preview-features {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.preview-features .section-header {
  text-align: center;
  margin-bottom: 50px;
}
.preview-features .section-tag {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(0,170,255,0.12);
  border: 1px solid rgba(0,170,255,0.3);
  border-radius: 20px;
  color: #7dd3fc;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.preview-features h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 12px;
}
.preview-features .section-sub {
  color: #8899aa;
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.feature-card {
  background: linear-gradient(160deg, rgba(0,30,60,0.6), rgba(0,10,25,0.4));
  border: 1px solid rgba(0,170,255,0.2);
  border-radius: 20px;
  padding: 32px 28px;
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00d4ff, transparent);
  opacity: 0;
  transition: opacity 0.4s;
}
.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0,212,255,0.5);
  box-shadow: 0 12px 50px rgba(0,102,204,0.25);
}
.feature-card:hover::before {
  opacity: 1;
}
.feature-card .icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}
.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
}
.feature-card .fr {
  color: #7dd3fc;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: block;
}
.feature-card p {
  color: #99aabb;
  font-size: 0.92rem;
  line-height: 1.7;
}
.feature-card .locked-badge {
  display: inline-block;
  margin-top: 14px;
  padding: 5px 14px;
  background: rgba(0,170,255,0.1);
  border: 1px solid rgba(0,170,255,0.25);
  border-radius: 12px;
  font-size: 0.75rem;
  color: #7dd3fc;
  font-weight: 700;
}

/* ============ PREVIEW CTA SECTION ============ */
.preview-cta-section {
  padding: 80px 24px;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(0,102,204,0.08), transparent 70%);
}
.preview-cta-section h2 {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 16px;
}
.preview-cta-section p {
  color: #99aabb;
  font-size: 1.05rem;
  margin-bottom: 32px;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}
.preview-footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid rgba(0,170,255,0.1);
  color: #556677;
  font-size: 0.82rem;
}

/* ============ ADMIN PANEL ============ */
.admin-body {
  font-family: 'Cairo', sans-serif;
  background: #000510;
  color: #fff;
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(0,170,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,170,255,0.04) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0%, rgba(0,102,204,0.10), transparent 50%);
  background-size: 50px 50px, 50px 50px, 100% 100%;
}
.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 90px 24px 60px;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.admin-header h1 {
  font-size: 1.8rem;
  font-weight: 900;
}
.admin-header .subtitle {
  color: #7dd3fc;
  font-size: 0.9rem;
}
.admin-back {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(0,170,255,0.3);
  transition: all 0.3s;
}
.admin-back:hover {
  background: rgba(0,170,255,0.1);
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.admin-stat-card {
  background: linear-gradient(160deg, rgba(0,30,60,0.6), rgba(0,10,25,0.4));
  border: 1px solid rgba(0,170,255,0.2);
  border-radius: 16px;
  padding: 22px 24px;
  text-align: center;
}
.admin-stat-card .num {
  font-size: 2rem;
  font-weight: 900;
  color: #00d4ff;
}
.admin-stat-card .label {
  font-size: 0.82rem;
  color: #8899aa;
  margin-top: 6px;
  font-weight: 600;
}
.admin-section {
  background: linear-gradient(160deg, rgba(0,30,60,0.5), rgba(0,10,25,0.3));
  border: 1px solid rgba(0,170,255,0.2);
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 24px;
}
.admin-section h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
@media (max-width: 768px) {
  .admin-form-row {
    grid-template-columns: 1fr;
  }
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid rgba(0,170,255,0.12);
  font-size: 0.88rem;
}
.admin-table th {
  color: #7dd3fc;
  font-weight: 700;
  font-size: 0.82rem;
}
.admin-table td .role-badge {
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
}
.admin-table td .role-badge.admin {
  background: rgba(0,212,255,0.15);
  color: #00d4ff;
  border: 1px solid rgba(0,212,255,0.3);
}
.admin-table td .role-badge.user {
  background: rgba(0,170,255,0.08);
  color: #7dd3fc;
  border: 1px solid rgba(0,170,255,0.2);
}
.admin-table .action-btn {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  margin: 2px;
  transition: all 0.2s;
}
.admin-table .action-btn.danger {
  background: rgba(255,68,102,0.12);
  color: #ff8899;
  border: 1px solid rgba(255,68,102,0.3);
}
.admin-table .action-btn.danger:hover {
  background: rgba(255,68,102,0.22);
}
.admin-table .action-btn.warn {
  background: rgba(255,170,0,0.12);
  color: #ffcc66;
  border: 1px solid rgba(255,170,0,0.3);
}
.admin-table .action-btn.warn:hover {
  background: rgba(255,170,0,0.22);
}
.admin-table .you-badge {
  font-size: 0.7rem;
  color: #66ffaa;
  margin-right: 6px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .preview-hero h1 { font-size: 2rem; }
  .preview-hero p { font-size: 1rem; }
  .preview-stats { gap: 28px; }
  .preview-stat .num { font-size: 1.8rem; }
  .features-grid { grid-template-columns: 1fr; }
  .user-controls { gap: 6px; padding-left: 6px; }
  .user-name { font-size: 0.75rem; }
  .user-admin-link, .btn-logout { font-size: 0.75rem; padding: 5px 10px; }
  .auth-card { padding: 32px 24px; }
  .preview-nav { padding: 12px 16px; }
  .admin-container { padding: 80px 16px 40px; }
}
