/* =========================================================
   components.css
   Archivo para componentes reutilizables:
   - inputs
   - buttons
   - mascot
   - footer
   - toast
   - loader global
   ========================================================= */

/* =========================
   FORM ELEMENTS
========================= */

input,
select {
  width: 100%;
  padding: 12px;
  margin: 8px 0;

  border: none;
  border-radius: var(--radius-input);

  outline: none;
}

input:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.45);
}

/* =========================
   BUTTONS
========================= */

button {
  width: 100%;
  padding: 13px;
  margin-top: 8px;

  color: white;
  font-weight: bold;

  background: linear-gradient(135deg, #22c55e, #16a34a);

  border: none;
  border-radius: var(--radius-button);
  cursor: pointer;
}

button:hover {
  background: #16a34a;
}

button.loading {
  opacity: 0.8;
  cursor: wait;
  pointer-events: none;
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* =========================
   MASCOT
========================= */

.mascot {
  width: 100px;
  margin-bottom: 10px;
  animation: float 2s ease-in-out infinite;
}

.mascot.celebrate {
  animation: mascotCelebrate 0.7s ease-in-out;
}

/* =========================
   FOOTER
========================= */

.app-footer {
  margin-top: 40px;
  padding: 20px 10px;

  background: linear-gradient(90deg, var(--br-green), var(--br-blue));

  color: white;
  text-align: center;
}

.footer-copy p {
  margin: 4px 0;
  font-size: 0.9rem;
}

.dev-credit a {
  color: var(--br-yellow);
  text-decoration: none;
  font-weight: 600;
}

.dev-credit a:hover {
  text-decoration: underline;
}

.footer-description {
  max-width: 620px;
  margin: 0 auto 28px;

  text-align: center;
  line-height: 1.7;
}

/* =========================
   TOAST MESSAGES
========================= */

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;

  padding: 14px 18px;

  color: white;
  font-weight: bold;
  font-size: 14px;

  background: #2563eb;
  border-radius: 14px;

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);

  opacity: 0;
  transform: translateY(-10px);
  transition: 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: #16a34a;
}

.toast.error {
  background: #dc2626;
}

.toast.info {
  background: #2563eb;
}

/* =========================
   GLOBAL APP LOADER
========================= */

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(10px);

  opacity: 0;
  pointer-events: none;
  transition: 0.3s ease;
}

.app-loader.show {
  opacity: 1;
  pointer-events: all;
}

.loader-mascot {
  width: 130px;
  animation: loaderFloat 2s ease-in-out infinite;
}

.loader-text {
  margin-top: 18px;

  color: white;
  font-size: 18px;
  font-weight: bold;
}

.loader-subtext {
  margin-top: 8px;

  color: #cbd5e1;
  font-size: 14px;
}

.loader-spinner {
  width: 44px;
  height: 44px;

  margin-top: 22px;

  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top: 4px solid #22c55e;
  border-radius: 50%;

  animation: spin 1s linear infinite;
}

/* =========================
   ANIMATIONS
========================= */

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes mascotCelebrate {
  0% {
    transform: scale(1) rotate(0deg);
  }

  35% {
    transform: scale(1.15) rotate(-6deg);
  }

  70% {
    transform: scale(1.1) rotate(6deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes loaderFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {
  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .app-footer {
    width: 100%;
  }
}