/* ============================================
   AUTH.CSS - SpainRol Los Petroleros
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Oswald:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --red-primary: #CC0000;
  --red-dark: #8B0000;
  --red-light: #FF3333;
  --red-glow: rgba(204,0,0,0.6);
  --gold: #FFD700;
  --gold-dark: #FFA500;
  --gold-glow: rgba(255,215,0,0.5);
  --bg-dark: #050505;
  --bg-card: rgba(10,10,10,0.85);
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255,255,255,0.7);
  --border: rgba(204,0,0,0.3);
  --border-gold: rgba(255,215,0,0.2);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* ---- Background Animation ---- */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: 
    radial-gradient(ellipse at 20% 80%, rgba(204,0,0,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(255,140,0,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(139,0,0,0.1) 0%, transparent 80%),
    #050505;
  overflow: hidden;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(204,0,0,0.02) 2px,
      rgba(204,0,0,0.02) 4px
    );
}

.fire-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  bottom: -20px;
  border-radius: 50% 50% 30% 30%;
  animation: fireFloat linear infinite;
  filter: blur(1px);
}

@keyframes fireFloat {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0.8; }
  25% { transform: translateY(-25vh) translateX(20px) scale(1.2); }
  50% { transform: translateY(-50vh) translateX(-15px) scale(0.9); opacity: 0.5; }
  75% { transform: translateY(-75vh) translateX(10px) scale(0.6); opacity: 0.2; }
  100% { transform: translateY(-105vh) translateX(5px) scale(0.2); opacity: 0; }
}

/* ---- Orbs ---- */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbPulse ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}
.orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(204,0,0,0.3), transparent);
  top: -100px; left: -100px;
  animation-duration: 8s;
}
.orb-2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,165,0,0.2), transparent);
  bottom: -50px; right: -50px;
  animation-duration: 10s; animation-delay: -3s;
}
.orb-3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,215,0,0.15), transparent);
  top: 50%; left: 50%;
  animation-duration: 6s; animation-delay: -5s;
}
@keyframes orbPulse {
  0%,100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* ---- Auth Container ---- */
.auth-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* ---- Logo Section ---- */
.logo-section {
  text-align: center;
  animation: fadeInDown 0.8s ease;
}

.logo-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.logo-badge {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-inner {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--red-dark), var(--red-primary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
  z-index: 3;
  box-shadow: 0 0 30px var(--red-glow), 0 0 60px rgba(204,0,0,0.3);
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%,100% { box-shadow: 0 0 30px var(--red-glow), 0 0 60px rgba(204,0,0,0.3); }
  50% { box-shadow: 0 0 50px var(--red-glow), 0 0 100px rgba(204,0,0,0.5), 0 0 20px var(--gold-glow); }
}

.logo-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid;
  animation: ringRotate linear infinite;
}
.ring-1 { width: 80px; height: 80px; border-color: rgba(204,0,0,0.5); animation-duration: 6s; }
.ring-2 { width: 90px; height: 90px; border-color: rgba(255,215,0,0.3); animation-duration: 9s; animation-direction: reverse; }
.ring-3 { width: 100px; height: 100px; border-color: rgba(204,0,0,0.2); animation-duration: 12s; }

@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.brand-title {
  font-family: 'Oswald', sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.brand-spain {
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow), 0 0 40px rgba(255,215,0,0.3);
}

.brand-rol {
  color: var(--red-light);
  text-shadow: 0 0 20px var(--red-glow), 0 0 40px rgba(204,0,0,0.3);
}

.brand-subtitle {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  animation: subtitleGlow 2s ease-in-out infinite alternate;
}

@keyframes subtitleGlow {
  from { text-shadow: 0 0 10px var(--gold-glow); }
  to { text-shadow: 0 0 20px var(--gold-glow), 0 0 40px rgba(255,165,0,0.4); }
}

.brand-divider {
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--red-light), transparent);
  margin: 0.5rem auto;
  animation: dividerShine 3s ease-in-out infinite;
}

@keyframes dividerShine {
  0%,100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.brand-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Auth Card ---- */
.auth-card {
  width: 100%;
  background: rgba(8,8,8,0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 
    0 0 40px rgba(204,0,0,0.15),
    0 0 80px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.05);
  animation: fadeInUp 0.8s ease 0.2s both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Tabs ---- */
.auth-tabs {
  display: flex;
  position: relative;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
}

.tab-btn {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: color 0.3s ease;
  position: relative;
  z-index: 1;
}

.tab-btn.active { color: var(--text-primary); }
.tab-btn:hover { color: var(--gold); }

.tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--red-primary), var(--gold));
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 10px var(--red-glow);
}

/* ---- Forms ---- */
.auth-form {
  padding: 2rem;
  display: none;
  flex-direction: column;
  gap: 1.2rem;
  animation: formFadeIn 0.3s ease;
}

.auth-form.active { display: flex; }

@keyframes formFadeIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.9rem;
  font-size: 0.9rem;
  z-index: 1;
}

.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(204,0,0,0.2);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
  border-color: var(--red-primary);
  background: rgba(204,0,0,0.05);
  box-shadow: 0 0 0 3px rgba(204,0,0,0.1), 0 0 20px rgba(204,0,0,0.1);
}

.input-wrapper input::placeholder { color: rgba(255,255,255,0.25); }
.input-wrapper select option { background: #111; color: #fff; }

.eye-btn {
  position: absolute;
  right: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.eye-btn:hover { opacity: 1; }

/* ---- Submit Button ---- */
.submit-btn {
  position: relative;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--red-dark) 0%, var(--red-primary) 50%, var(--red-light) 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(204,0,0,0.5), 0 0 20px var(--gold-glow);
  background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-light) 50%, var(--gold-dark) 100%);
}

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

.btn-glow {
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.submit-btn:hover .btn-glow { left: 100%; }

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---- Messages ---- */
.error-msg {
  padding: 0.7rem 1rem;
  background: rgba(204,0,0,0.1);
  border: 1px solid rgba(204,0,0,0.4);
  border-radius: 6px;
  color: #FF6B6B;
  font-size: 0.85rem;
  animation: shake 0.4s ease;
}

.success-msg {
  padding: 0.7rem 1rem;
  background: rgba(0,200,100,0.1);
  border: 1px solid rgba(0,200,100,0.4);
  border-radius: 6px;
  color: #4ADE80;
  font-size: 0.85rem;
}

.hidden { display: none !important; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-5px); }
  40%,80% { transform: translateX(5px); }
}

.register-notice {
  font-size: 0.75rem;
  color: var(--gold-dark);
  text-align: center;
  opacity: 0.8;
  margin-top: -0.5rem;
}

.auth-footer {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.2);
  text-align: center;
  letter-spacing: 0.05em;
}

/* ---- Responsive ---- */
@media (max-width: 520px) {
  .auth-container { padding: 1rem; }
  .brand-title { font-size: 2rem; }
  .auth-form { padding: 1.5rem; }
}
