/* ============================================
   auth.css — Login / Signup Screens
   Theme: Dark Emerald Islamic Gaming
   ============================================ */

/* === AUTH CARD === */
.auth-card {
  max-width: 440px;
  padding: 0;
  overflow: hidden;
  gap: 0;
}

/* Top banner */
.auth-banner {
  width: 100%;
  padding: 32px 28px 24px;
  text-align: center;
  background: linear-gradient(160deg, #071810 0%, #0d2518 60%, #071408 100%);
  border-bottom: 1px solid #00c47220;
  position: relative;
  overflow: hidden;
}
.auth-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% 0%, #00c47215 0%, transparent 70%);
}
.auth-banner-icon {
  font-size: 3.2rem;
  display: block;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 16px #00c47280);
  animation: iconFloat 3s ease-in-out infinite;
}
@keyframes iconFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}
.auth-banner h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold-light), var(--emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px var(--emerald-glow));
  margin-bottom: 6px;
}
.auth-banner p {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: 'Tajawal', sans-serif;
}

/* === AUTH TABS === */
.auth-tabs {
  display: flex;
  width: 100%;
  border-bottom: 1px solid #00c47218;
  background: var(--bg-card);
}
.auth-tab {
  flex: 1;
  padding: 14px 10px;
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--trans);
  position: relative;
  letter-spacing: 0.3px;
}
.auth-tab::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 2px;
  background: linear-gradient(90deg, var(--emerald), var(--gold));
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.auth-tab.active {
  color: var(--emerald);
}
.auth-tab.active::after {
  transform: scaleX(1);
}
.auth-tab:hover:not(.active) {
  color: var(--text-secondary);
  background: var(--emerald-soft);
}

/* === AUTH BODY === */
.auth-body {
  width: 100%;
  padding: 26px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* === FORM PANEL === */
.auth-form-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: authFadeIn 0.35s ease both;
}
.auth-form-panel.active {
  display: flex;
}
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === INPUT WRAPPER with icon === */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input-icon {
  position: absolute;
  left: 13px;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}
.auth-input-wrap input {
  padding-left: 40px !important;
  width: 100%;
}
.auth-input-wrap .toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  padding: 4px;
  transition: color 0.2s;
}
.auth-input-wrap .toggle-pw:hover { color: var(--emerald); }

/* === INPUT LABEL === */
.auth-label {
  color: var(--text-secondary);
  font-size: 0.88em;
  font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  margin-bottom: 4px;
  display: block;
}

/* === DIVIDER === */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.82em;
  font-family: 'Tajawal', sans-serif;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00c47225, transparent);
}

/* === GOOGLE BUTTON === */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid #00c47225;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: var(--trans);
  box-shadow: 3px 3px 8px var(--neu-dark), -2px -2px 6px var(--neu-light);
}
.btn-google:hover {
  background: var(--bg-card-light);
  border-color: #4285f4;
  box-shadow: 3px 3px 8px var(--neu-dark), -2px -2px 6px var(--neu-light), 0 0 16px #4285f420;
  transform: translateY(-1px);
}
.google-icon {
  width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.18 1.48-4.97 2.35-8.16 2.35-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E") center/contain no-repeat;
  flex-shrink: 0;
}

/* === GUEST BUTTON === */
.btn-guest {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed #00c47220;
  border-radius: var(--radius-md);
  padding: 11px 20px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
  transition: var(--trans);
}
.btn-guest:hover {
  color: var(--text-secondary);
  border-color: #00c47240;
  background: var(--emerald-soft);
  transform: translateY(-1px);
}

/* === PLAYER TYPE SELECT === */
.player-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}
.player-type-option {
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid #00c47218;
  cursor: pointer;
  text-align: center;
  transition: var(--trans);
  box-shadow: 2px 2px 6px var(--neu-dark), -1px -1px 4px var(--neu-light);
}
.player-type-option input[type="radio"] { display: none; }
.player-type-option .pt-icon { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.player-type-option .pt-name { font-size: 0.82rem; color: var(--text-secondary); font-weight: 600; }
.player-type-option .pt-desc { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.player-type-option:hover {
  border-color: var(--emerald-dim);
  background: var(--bg-card-light);
}
.player-type-option.selected {
  border-color: var(--emerald);
  background: var(--bg-card-light);
  box-shadow: 2px 2px 6px var(--neu-dark), -1px -1px 4px var(--neu-light), 0 0 14px var(--emerald-glow);
}
.player-type-option.selected .pt-name { color: var(--emerald); }

/* === ERROR / SUCCESS MSG === */
.auth-msg {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: 'Tajawal', sans-serif;
  text-align: center;
  animation: resultPop 0.3s ease;
  display: none;
}
.auth-msg.show { display: block; }
.auth-msg.error {
  background: linear-gradient(135deg, #180808, #100404);
  border: 1px solid #c4293b50;
  color: #ff9090;
}
.auth-msg.success {
  background: linear-gradient(135deg, #0d2518, #0a1c12);
  border: 1px solid var(--emerald-dim);
  color: var(--emerald);
}

/* === TERMS TEXT === */
.auth-terms {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  font-family: 'Tajawal', sans-serif;
  line-height: 1.5;
}

/* === FORGOT PASSWORD === */
.auth-forgot {
  text-align: right;
  font-size: 0.82rem;
  color: var(--emerald-dim);
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  transition: color 0.2s;
  margin-top: -6px;
}
.auth-forgot:hover { color: var(--emerald); }

/* === WELCOME BACK (after login) === */
.welcome-popup {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--emerald);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: 0 0 30px var(--emerald-glow), 8px 8px 20px var(--neu-dark);
  z-index: 500;
  max-width: 260px;
  animation: welcomeSlide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  display: none;
}
.welcome-popup.show { display: block; }
@keyframes welcomeSlide {
  from { opacity: 0; transform: translateX(60px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.welcome-popup .wp-name {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.welcome-popup .wp-coins {
  color: var(--emerald);
  font-size: 0.88rem;
  font-family: 'Tajawal', sans-serif;
}

/* === HEADER USER INFO === */
.header-coins {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-surface);
  border: 1px solid #00c47225;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.9rem;
  color: var(--gold-light);
  font-weight: 700;
  font-family: 'Tajawal', sans-serif;
  box-shadow: 2px 2px 6px var(--neu-dark);
}
.header-user {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: 'Tajawal', sans-serif;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .auth-body { padding: 20px 16px 22px; }
  .auth-banner { padding: 24px 16px 18px; }
  .auth-banner h2 { font-size: 1.3rem; }
  .player-type-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}
