/* Profile & Auth Pages */
/* ======= AUTH (Login / Register) ======= */
.view.active.auth-view {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: hidden;
  background: var(--bg);
}

/* ---- Fundo animado (login) ---- */
.auth-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.auth-bg-grid {
  position: absolute; inset: -50%;
  background-image:
    linear-gradient(rgba(255,92,26,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,92,26,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(500px) rotateX(60deg);
  animation: authGridDrift 20s linear infinite;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 70%);
}
@keyframes authGridDrift {
  0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(500px) rotateX(60deg) translateY(48px); }
}
.auth-bg-glow {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5;
  animation: authGlowFloat 8s ease-in-out infinite;
}
.auth-bg-glow--1 {
  width: 420px; height: 420px; background: rgba(255,92,26,0.18);
  top: -10%; left: -5%; animation-delay: 0s;
}
.auth-bg-glow--2 {
  width: 320px; height: 320px; background: rgba(212,168,71,0.12);
  bottom: -5%; right: -5%; animation-delay: -3s;
}
.auth-bg-glow--3 {
  width: 200px; height: 200px; background: rgba(255,92,26,0.1);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  animation-delay: -5s; animation-duration: 12s;
}
@keyframes authGlowFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.45; }
  33% { transform: translate(30px, -20px) scale(1.08); opacity: 0.6; }
  66% { transform: translate(-20px, 25px) scale(0.95); opacity: 0.35; }
}
.auth-bg-glow--3 {
  animation-name: authGlowPulse;
}
@keyframes authGlowPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.55; }
}

/* Partículas flutuantes */
.auth-particles span {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: var(--primary); opacity: 0;
  animation: authParticle 6s ease-in-out infinite;
}
.auth-particles span:nth-child(1)  { left: 10%; top: 20%; animation-delay: 0s; }
.auth-particles span:nth-child(2)  { left: 25%; top: 70%; animation-delay: 0.8s; background: var(--gold); }
.auth-particles span:nth-child(3)  { left: 40%; top: 15%; animation-delay: 1.6s; }
.auth-particles span:nth-child(4)  { left: 55%; top: 85%; animation-delay: 2.4s; }
.auth-particles span:nth-child(5)  { left: 70%; top: 30%; animation-delay: 3.2s; background: var(--gold); }
.auth-particles span:nth-child(6)  { left: 85%; top: 60%; animation-delay: 4s; }
.auth-particles span:nth-child(7)  { left: 15%; top: 45%; animation-delay: 1.2s; width: 2px; height: 2px; }
.auth-particles span:nth-child(8)  { left: 60%; top: 50%; animation-delay: 2.8s; width: 4px; height: 4px; background: var(--gold); }
.auth-particles span:nth-child(9)  { left: 90%; top: 15%; animation-delay: 3.6s; }
.auth-particles span:nth-child(10) { left: 5%;  top: 80%; animation-delay: 4.4s; background: var(--gold); }
.auth-particles span:nth-child(11) { left: 35%; top: 55%; animation-delay: 0.4s; width: 2px; height: 2px; }
.auth-particles span:nth-child(12) { left: 50%; top: 25%; animation-delay: 1.8s; }
.auth-particles span:nth-child(13) { left: 75%; top: 75%; animation-delay: 2.2s; background: var(--gold); }
.auth-particles span:nth-child(14) { left: 20%; top: 90%; animation-delay: 3.8s; width: 2px; height: 2px; }
.auth-particles span:nth-child(15) { left: 95%; top: 40%; animation-delay: 5s; }
@keyframes authParticle {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
  20% { opacity: 0.8; }
  50% { opacity: 0.4; transform: translateY(-40px) scale(1); }
  80% { opacity: 0.6; }
}

/* ---- Card ---- */
.auth-card {
  width: 100%; max-width: 400px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 40px 36px; box-shadow: var(--shadow);
  position: relative; z-index: 1;
}
.auth-card--login {
  max-width: 420px;
  background: rgba(26, 26, 31, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 92, 26, 0.2);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 24px 64px rgba(0,0,0,0.5),
    0 0 80px rgba(255,92,26,0.08);
  animation: authCardIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
:root[data-theme="light"] .auth-card--login {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 92, 26, 0.25);
  box-shadow: 0 24px 64px rgba(0,0,0,0.12), 0 0 60px rgba(255,92,26,0.06);
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Logo hero ---- */
.auth-logo {
  text-align: center; margin-bottom: 32px;
}
.auth-logo--hero { margin-bottom: 28px; }
.auth-logo-frame {
  position: relative; width: 120px; height: 120px; margin: 0 auto 20px;
}
.auth-logo-ring {
  position: absolute; inset: -8px; border-radius: 24px;
  border: 2px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box,
              linear-gradient(135deg, var(--primary), var(--gold), var(--primary)) border-box;
  animation: authRingSpin 4s linear infinite;
  opacity: 0.85;
}
@keyframes authRingSpin {
  0% { filter: hue-rotate(0deg); box-shadow: 0 0 24px rgba(255,92,26,0.3); }
  50% { box-shadow: 0 0 36px rgba(212,168,71,0.4); }
  100% { filter: hue-rotate(0deg); box-shadow: 0 0 24px rgba(255,92,26,0.3); }
}
.auth-logo-main {
  position: relative; z-index: 1;
  width: 120px; height: 120px; border-radius: 20px; object-fit: cover;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: authLogoFloat 3s ease-in-out infinite;
}
@keyframes authLogoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.auth-logo h1 {
  font-family: var(--font-display); font-size: 2.4rem; font-weight: 700;
  color: var(--primary); letter-spacing: 0.06em;
  text-shadow: 0 0 40px rgba(255,92,26,0.35);
  animation: authTitleGlow 3s ease-in-out infinite;
}
@keyframes authTitleGlow {
  0%, 100% { text-shadow: 0 0 30px rgba(255,92,26,0.3); }
  50% { text-shadow: 0 0 50px rgba(255,92,26,0.5), 0 0 80px rgba(212,168,71,0.2); }
}
.auth-logo h1 span { color: var(--gold); }
.auth-tagline {
  color: var(--text-sec); font-size: 0.9rem; margin-top: 6px;
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500;
}
.auth-tagline-bar {
  margin: 14px auto 0; width: 80px; height: 3px;
  background: var(--border); border-radius: 99px; overflow: hidden;
}
.auth-tagline-bar span {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: 99px;
  animation: authBarSlide 2s ease-in-out infinite;
}
@keyframes authBarSlide {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(250%); }
}

.auth-logo-img {
  width: 72px; height: 72px; border-radius: 16px; object-fit: cover;
  margin: 0 auto 12px; display: block;
}

/* ---- Formulário login ---- */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form--login { gap: 18px; }
.input-group--auth label {
  font-size: 0.75rem; letter-spacing: 0.1em;
}
.input-wrap {
  position: relative; display: flex; align-items: center;
}
.input-icon {
  position: absolute; left: 14px; color: var(--text-dim);
  pointer-events: none; transition: color var(--transition);
}
.input--auth {
  padding-left: 42px;
  background: rgba(13, 13, 15, 0.6);
  border-color: rgba(255,255,255,0.08);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
:root[data-theme="light"] .input--auth {
  background: rgba(247, 246, 243, 0.8);
  border-color: var(--border);
}
.input-wrap:focus-within .input-icon { color: var(--primary); }
.input--auth:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow), 0 0 20px rgba(255,92,26,0.1);
  background: var(--bg3);
}

.auth-submit-btn {
  position: relative; overflow: hidden; margin-top: 4px;
  background: linear-gradient(135deg, var(--primary) 0%, #e04800 100%);
  border: none; gap: 10px;
  box-shadow: 0 4px 24px rgba(255,92,26,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.auth-submit-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.2) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: authBtnShimmer 3s ease-in-out infinite;
}
@keyframes authBtnShimmer {
  0%, 70%, 100% { transform: translateX(-100%); }
  85% { transform: translateX(100%); }
}
.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255,92,26,0.45);
}
.auth-submit-btn:active { transform: translateY(0); }
.auth-submit-btn span, .auth-submit-btn svg { position: relative; z-index: 1; }

.auth-footer { text-align: center; font-size: 0.82rem; color: var(--text-sec); margin-top: 16px; }
.auth-footer--login {
  margin-top: 22px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.auth-footer--login a {
  color: var(--gold); font-weight: 600;
  transition: color 0.2s, text-shadow 0.2s;
}
.auth-footer--login a:hover {
  color: var(--primary);
  text-shadow: 0 0 12px rgba(255,92,26,0.4);
}

/* Register view — fundo simples */
.view.active.auth-view:not(.auth-view--login) {
  background-image: radial-gradient(ellipse at 60% 20%, rgba(255,92,26,0.06) 0%, transparent 60%),
                    radial-gradient(ellipse at 20% 80%, rgba(212,168,71,0.04) 0%, transparent 50%);
}

/* Register multi-step */
.register-steps { display: flex; gap: 8px; margin-bottom: 28px; }
.register-step {
  flex: 1; height: 4px; border-radius: 99px; background: var(--border); transition: background 0.3s;
}
.register-step.done { background: var(--success); }
.register-step.active { background: var(--primary); }

/* Invite banner */
.invite-banner {
  background: var(--gold-dim); border: 1px solid var(--gold);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px;
  font-size: 0.85rem; color: var(--gold); display: flex; align-items: center; gap: 8px;
}

/* ======= PROFILE ======= */
.profile-view { flex: 1; overflow-y: auto; padding: 28px; max-width: 640px; margin: 0 auto; width: 100%; }
.profile-hero {
  display: flex; align-items: center; gap: 20px; margin-bottom: 28px;
  padding: 24px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.profile-avatar-wrap { position: relative; cursor: pointer; }
.profile-avatar-wrap .avatar { width: 80px; height: 80px; font-size: 1.8rem; }
.profile-avatar-edit {
  position: absolute; bottom: 0; right: 0; width: 26px; height: 26px;
  background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card); color: #fff;
}
.profile-info { flex: 1; }
.profile-name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.profile-ff-id { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-sec); margin-top: 2px; }
.profile-since { font-size: 0.75rem; color: var(--text-dim); margin-top: 6px; }
.profile-ranks {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px;
}
.rank-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 6px;
}
.rank-card-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); font-weight: 600; }
.rank-card-value { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--gold); }
.profile-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.profile-form h3 { font-family: var(--font-display); margin-bottom: 18px; }
.profile-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-form-grid .span-2 { grid-column: 1 / -1; }

/* Invite section */
.invite-section {
  margin-top: 20px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.invite-link-box {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--text-sec); margin-top: 10px; word-break: break-all;
}
.invite-link-box .copy-btn { flex-shrink: 0; cursor: pointer; color: var(--primary); }

/* Sair da conta — visível no Perfil (mobile) */
.profile-logout-section {
  display: none;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.profile-logout-btn {
  color: var(--danger) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: var(--danger) !important;
}

/* Rules page */
.rules-view {
  flex: 1; max-width: 720px; margin: 0 auto; padding: 32px 24px; overflow-y: auto; width: 100%;
}
.rules-header { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.rules-header svg { color: var(--gold); }
.rules-content {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; white-space: pre-wrap; line-height: 1.8; font-size: 0.95rem;
}
.admins-section { margin-top: 28px; }
.admins-section h3 { font-family: var(--font-display); margin-bottom: 14px; color: var(--gold); }
.admin-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .profile-logout-section { display: block; }
}

@media (max-width: 600px) {
  .auth-card { padding: 28px 20px; }
  .auth-card--login { padding: 32px 22px; }
  .auth-logo-frame, .auth-logo-main { width: 96px; height: 96px; }
  .auth-logo h1 { font-size: 2rem; }
  .profile-hero { flex-direction: column; text-align: center; }
  .profile-form-grid { grid-template-columns: 1fr; }
  .profile-ranks { grid-template-columns: 1fr; }
}
