@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Playfair+Display:wght@700;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  margin: 0;
  padding: 0;
  background: #050a0e;
  overflow-x: hidden;
}

.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  overflow: hidden;
  z-index: 1;
}

.login-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.bg-animation::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(#050a0e, #0d4a1f, #16a34a, #050a0e);
  animation: animate 7s linear infinite;
}

@keyframes animate {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.bg-animation span {
  position: relative;
  display: block;
  width: calc(6.25vw - 2px);
  height: calc(6.25vw - 2px);
  background: #080f0a;
  z-index: 2;
  transition: 1.5s;
}

.bg-animation span:hover {
  background: linear-gradient(135deg, #16a34a, #064e3b);
  transition: 0s;
}

/* ── Card ── */
.signin {
  position: absolute;
  width: 420px;
  background: rgba(6, 14, 9, 0.96);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 38px 38px;
  border-radius: 14px;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(22, 163, 74, 0.18);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.signin .content {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 0;
}

/* ── Brand icon ── */
.brand-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  animation: floatIcon 3s ease-in-out infinite;
}

.brand-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.5));
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-5px); }
}

/* ── Brand title ── */
.brand-title {
  text-align: center;
  margin-bottom: 20px;
}

.brand-sub {
  font-size: 0.78em;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #4ade80;
  opacity: 0;
  animation: fadeSlideUp 0.6s ease forwards 0.2s;
  margin-bottom: 4px;
}

.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 2.6em;
  font-weight: 900;
  line-height: 1;
  display: flex;
  justify-content: center;
  gap: 1px;
}

/* Animación letra por letra */
.brand-name .letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) scale(0.8);
  animation: letterReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(0.4s + var(--i) * 0.08s);

  /* Gradiente verde → azul en las letras */
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 40%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(74, 222, 128, 0.6));
}

@keyframes letterReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulso sutil continuo en el título */
.brand-name {
  animation: titlePulse 4s ease-in-out infinite 1.5s;
}

@keyframes titlePulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.3)); }
  50%       { filter: drop-shadow(0 0 18px rgba(74, 222, 128, 0.6)); }
}

/* ── Divider ── */
.divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #22c55e, #3b82f6, transparent);
  border-radius: 2px;
  margin: 4px 0 24px;
  animation: dividerGrow 0.6s ease forwards 1.2s;
  transform: scaleX(0);
}

@keyframes dividerGrow {
  to { transform: scaleX(1); }
}

/* ── Form ── */
.form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form .inputBox {
  width: 100%;
}

.form .inputBox .input-wrapper {
  position: relative;
  width: 100%;
}

.form .inputBox .input-wrapper input {
  position: relative;
  width: 100%;
  background: #0d1f13;
  border: 2px solid transparent;
  outline: none;
  padding: 20px 15px 8px;
  border-radius: 12px;
  color: #e2f7e9;
  font-weight: 500;
  font-size: 0.95em;
  transition: 0.3s;
}

.form .inputBox .input-wrapper input:focus {
  border: 2px solid #22c55e;
  background: #102718;
}

.form .inputBox .input-wrapper input.is-invalid {
  border-color: #ef4444;
}

.form .inputBox .input-wrapper i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  color: #4b7a5a;
  transition: 0.3s;
  pointer-events: none;
  font-size: 0.95em;
}

.form .inputBox .input-wrapper input:focus ~ i,
.form .inputBox .input-wrapper input:valid ~ i {
  top: 12px;
  transform: translateY(0);
  font-size: 0.75em;
  color: #22c55e;
  font-weight: 600;
}

.form .inputBox .input-wrapper input.is-invalid ~ i {
  color: #ef4444;
}

/* Error message */
.error-msg {
  display: block;
  margin-top: 6px;
  padding-left: 10px;
  color: #ef4444;
  font-size: 0.8em;
  font-weight: 500;
}

/* ── Options (Remember me & Links) ── */
.form .options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -6px;
  width: 100%;
}

.form .options label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5a8a6a;
  font-size: 0.85em;
  cursor: pointer;
  transition: 0.3s;
}

.form .options label:hover {
  color: #4ade80;
}

.form .options input[type="checkbox"] {
  accent-color: #22c55e;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.form .options a {
  color: #5a8a6a;
  text-decoration: none;
  font-size: 0.85em;
  transition: 0.3s;
}

.form .options a:hover {
  color: #4ade80;
}

/* ── Submit button ── */
.form .inputBox input[type="submit"],
.form .inputBox button[type="submit"] {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #16a34a, #15803d, #1d4ed8);
  background-size: 200% 100%;
  color: #fff;
  font-weight: 700;
  font-size: 1em;
  letter-spacing: 1.5px;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  margin-top: 4px;
  text-transform: uppercase;
  transition: 0.4s;
  box-shadow: 0 8px 28px rgba(22, 163, 74, 0.35);
  animation: shimmer 3s ease infinite;
}

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.form .inputBox button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(22, 163, 74, 0.5);
}

.form .inputBox button[type="submit"]:active {
  transform: translateY(0);
  opacity: 0.9;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .bg-animation span {
    width: calc(10vw - 2px);
    height: calc(10vw - 2px);
  }
}

@media (max-width: 600px) {
  .bg-animation span {
    width: calc(20vw - 2px);
    height: calc(20vw - 2px);
  }

  .signin {
    width: 100%;
    padding: 30px 20px;
  }

  .brand-name {
    font-size: 2em;
  }
}
