* {
  box-sizing: border-box;
  font-family: 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  height: 100vh;
  background: #0f172a;
  overflow: hidden;
}

/* BACKGROUND */
.background {
  position: absolute;
  inset: 0;
}

.blob {
  position: absolute;
  width: 420px;
  height: 420px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.55;
  animation: float 14s infinite alternate ease-in-out;
}

.blob1 { top: -120px; left: -120px; }
.blob2 { bottom: -140px; right: -140px; animation-delay: 4s; }

@keyframes float {
  from { transform: translate(0,0); }
  to { transform: translate(80px,-80px); }
}

/* CARD */
.login-container {
  position: relative;
  z-index: 1;
  width: 360px;
  margin: auto;
  top: 50%;
  transform: translateY(-50%);
  padding: 40px;
  border-radius: 22px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(22px);
  box-shadow: 0 30px 90px rgba(0,0,0,0.55);
  animation: fadeIn 1s ease;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

body.success .login-container {
  transform: translateY(-50%) scale(0.95);
  opacity: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-60%); }
  to { opacity: 1; transform: translateY(-50%); }
}

h1 { color: white; margin-bottom: 8px; }
.subtitle { color: #cbd5f5; margin-bottom: 30px; }

/* INPUT FIELDS */
.field {
  position: relative;
  margin-bottom: 22px;
}

.field input {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  outline: none;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 15px;
}

.field label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #c7d2fe;
  pointer-events: none;
  transition: 0.25s ease;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: -8px;
  font-size: 12px;
  color: #22d3ee;
}

.field input:focus {
  box-shadow: 0 0 0 2px rgba(34,211,238,0.35);
}

/* BUTTON */
button {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  color: white;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

button:hover {
  box-shadow: 0 20px 50px rgba(99,102,241,0.45);
}

button.loading .btn-text { opacity: 0; }
button.loading .loader { opacity: 1; }

/* RIPPLE */
button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.3s;
}

button:active::after {
  opacity: 1;
}

/* LOADER */
.loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.loader::after {
  content: "";
  width: 22px;
  height: 22px;
  border: 3px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ERROR */
#error {
  margin-top: 15px;
  color: #f87171;
  text-align: center;
  min-height: 18px;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}
