/* ============================================================
   auth.css — Fan Identity System Styles
   England World Cup 2026
   ============================================================ */

/* ─── Overlay ─────────────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: authOverlayIn 0.35s ease-out;
}

.auth-overlay.closing {
  animation: authOverlayOut 0.35s ease-in forwards;
}

@keyframes authOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes authOverlayOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ─── Modal ───────────────────────────────────────────────── */
.auth-modal {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(160deg, #1A0A10 0%, #0D0508 60%, #120810 100%);
  border: 1px solid rgba(200, 16, 46, 0.35);
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow:
    0 0 0 1px rgba(200,16,46,0.15),
    0 24px 80px rgba(0,0,0,0.7),
    0 0 60px rgba(200,16,46,0.12);
  animation: authModalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(200,16,46,0.3) transparent;
}

.auth-overlay.closing .auth-modal {
  animation: authModalOut 0.3s ease-in forwards;
}

@keyframes authModalIn {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes authModalOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.92) translateY(12px); }
}

/* ─── Modal Header ────────────────────────────────────────── */
.auth-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-modal-flag {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(200,16,46,0.4));
}

.auth-modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: 0.1em;
  color: #FFFFFF;
  margin: 0 0 8px;
  line-height: 1;
}

.auth-modal-sub {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
  margin: 0;
}

/* ─── Section Labels ──────────────────────────────────────── */
.auth-section-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 10px;
  margin-top: 4px;
}

/* ─── Avatar Grid ─────────────────────────────────────────── */
.auth-avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.auth-avatar-btn {
  aspect-ratio: 1;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.auth-avatar-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(200,16,46,0.4);
  transform: scale(1.08);
}

.auth-avatar-btn.selected {
  background: rgba(200, 16, 46, 0.18);
  border-color: var(--eng-red, #C8102E);
  box-shadow: 0 0 0 1px rgba(200,16,46,0.3), 0 4px 16px rgba(200,16,46,0.3);
  transform: scale(1.12);
}

/* ─── Username Input ──────────────────────────────────────── */
.auth-input-wrap {
  position: relative;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 14px 50px 14px 16px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: #FFFFFF;
  font-family: 'Rajdhani', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.auth-input::placeholder {
  color: rgba(255,255,255,0.25);
  font-weight: 500;
}

.auth-input:focus {
  border-color: var(--eng-red, #C8102E);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.15);
}

.auth-input-count {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
}

.auth-input-error {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #FF6B6B;
  min-height: 18px;
  margin-bottom: 8px;
  display: none;
}

/* ─── Preview Strip ───────────────────────────────────────── */
.auth-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(200,16,46,0.1) 0%, rgba(200,16,46,0.04) 100%);
  border: 1px solid rgba(200,16,46,0.25);
  border-radius: 12px;
  margin: 12px 0 20px;
}

.auth-preview-avatar {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.auth-preview-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.auth-preview-name:not(:empty) {
  color: #FFFFFF;
}

/* ─── Submit Button ───────────────────────────────────────── */
.auth-submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #C8102E 0%, #A00D24 100%);
  border: none;
  border-radius: 12px;
  color: #FFFFFF;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(200,16,46,0.4);
  margin-bottom: 8px;
}

.auth-submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #E01235 0%, #C8102E 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(200,16,46,0.5);
}

.auth-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-cancel-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: rgba(255,255,255,0.5);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.auth-cancel-btn:hover {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.75);
}

/* ─── Disclaimer ──────────────────────────────────────────── */
.auth-disclaimer {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

/* ─── Nav Profile Pill ────────────────────────────────────── */
.nav-profile-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 8px;
  background: rgba(200,16,46,0.12);
  border: 1px solid rgba(200,16,46,0.3);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Rajdhani', sans-serif;
  color: #FFFFFF;
  flex-shrink: 0;
  max-width: 160px;
}

.nav-profile-pill:hover {
  background: rgba(200,16,46,0.22);
  border-color: rgba(200,16,46,0.5);
  box-shadow: 0 0 16px rgba(200,16,46,0.25);
}

.nav-profile-avatar {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.nav-profile-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

/* ─── Profile Slide Panel ─────────────────────────────────── */
.profile-panel {
  position: fixed;
  top: 60px;
  right: 16px;
  z-index: 15000;
  width: 280px;
  background: linear-gradient(160deg, #1A0A10 0%, #0D0508 100%);
  border: 1px solid rgba(200,16,46,0.3);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(200,16,46,0.1);
  animation: panelSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@keyframes panelSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-panel-inner {
  padding: 0;
}

.profile-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(200,16,46,0.12) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.profile-panel-avatar {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}

.profile-panel-info {
  flex: 1;
  min-width: 0;
}

.profile-panel-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-panel-id {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
}

.profile-panel-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.profile-panel-close:hover {
  color: rgba(255,255,255,0.8);
}

/* ─── Profile Stats ───────────────────────────────────────── */
.profile-stats-row {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.profile-stat {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.profile-stat:last-child {
  border-right: none;
}

.profile-stat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: var(--eng-red, #C8102E);
  letter-spacing: 0.05em;
  line-height: 1;
  margin-bottom: 4px;
}

.profile-stat-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
}

.profile-panel-joined {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ─── Profile Panel Actions ───────────────────────────────── */
.profile-panel-actions {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-edit-btn,
.profile-signout-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 9px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.profile-edit-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
}

.profile-edit-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.2);
  color: #FFFFFF;
}

.profile-signout-btn {
  background: rgba(200,16,46,0.08);
  border: 1px solid rgba(200,16,46,0.2);
  color: rgba(200,16,46,0.8);
}

.profile-signout-btn:hover {
  background: rgba(200,16,46,0.15);
  border-color: rgba(200,16,46,0.4);
  color: #C8102E;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-modal {
    padding: 24px 18px 20px;
    border-radius: 16px;
    max-height: 95vh;
  }

  .auth-modal-title {
    font-size: 26px;
  }

  .auth-avatar-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }

  .auth-avatar-btn {
    font-size: 20px;
    border-radius: 10px;
  }

  .profile-panel {
    width: calc(100vw - 32px);
    right: 16px;
  }
}

/* ─── Desktop nav pill adjustments ───────────────────────── */
@media (min-width: 768px) {
  .nav-profile-pill {
    max-width: 180px;
  }

  .nav-profile-name {
    max-width: 120px;
  }
}
