/* ============================================================
   GeoCad — Login 2027
   Diseño: glassmorphism + gradientes + micro-interacciones
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --g-primary: #28a745;
  --g-primary-dark: #1e7e34;
  --g-primary-light: #34ce57;
  --g-bg-1: #0b1526;
  --g-bg-2: #10223c;
  --g-text: #e9f3ec;
  --g-text-muted: #9db5a8;
  --g-glass: rgba(255, 255, 255, 0.06);
  --g-glass-border: rgba(255, 255, 255, 0.14);
  --g-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
  --g-radius: 20px;
  --g-font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --g-font-display: "Space Grotesk", "Plus Jakarta Sans", "Segoe UI", system-ui, Arial, sans-serif;
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--g-font);
  color: var(--g-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 20% 10%, #12331f 0%, transparent 50%),
              radial-gradient(ellipse at 85% 85%, #0f2a3d 0%, transparent 50%),
              linear-gradient(135deg, var(--g-bg-1) 0%, var(--g-bg-2) 55%, #0a1626 100%);
  background-attachment: fixed;
}

/* ---- Fondo animado: orbes + grid ---- */
.bg-orbe {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  z-index: 0;
  animation: floatOrbe 14s ease-in-out infinite;
}

.bg-orbe-1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(40, 167, 69, 0.55), transparent 70%);
  top: -120px;
  left: -100px;
}

.bg-orbe-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(23, 162, 184, 0.35), transparent 70%);
  bottom: -140px;
  right: -90px;
  animation-delay: -6s;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 40%, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 0%, transparent 75%);
}

@keyframes floatOrbe {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(30px, -25px) scale(1.08); }
}

/* ---- Tarjeta glassmorphism ---- */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--g-glass);
  border: 1px solid var(--g-glass-border);
  border-radius: var(--g-radius);
  box-shadow: var(--g-shadow);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  padding: 44px 38px 34px;
  animation: cardIn 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Marca ---- */
.login-brand {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  width: 260px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(40, 167, 69, 0.5));
}

.login-brand h1 {
  font-family: var(--g-font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #fff 0%, var(--g-primary-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--g-primary-light);
  line-height: 1.2;
  text-shadow: 0 2px 18px rgba(40, 167, 69, 0.35);
}

.login-brand p {
  color: var(--g-text-muted);
  font-size: 15px;
  font-weight: 500;
  margin-top: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.login-version {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 14px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--g-primary-light);
  background: rgba(40, 167, 69, 0.14);
  border: 1px solid rgba(40, 167, 69, 0.4);
  border-radius: 999px;
}

/* ---- Alertas ---- */
.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 12px;
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid;
  animation: alertIn 0.45s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.login-alert.dismissed {
  opacity: 0;
  transform: translateY(-8px);
}

.login-alert svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.login-alert-danger {
  background: rgba(220, 53, 69, 0.16);
  border-color: rgba(220, 53, 69, 0.45);
  color: #ffc1c7;
}

.login-alert-warning {
  background: rgba(255, 193, 7, 0.14);
  border-color: rgba(255, 193, 7, 0.45);
  color: #ffe7a3;
}

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

/* ---- Formulario ---- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--g-text);
}

.field label .req {
  color: #ff8fa3;
}

.input-wrap {
  position: relative;
}

.input-wrap .ic {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--g-text-muted);
  width: 20px;
  height: 20px;
  pointer-events: none;
  transition: color 0.25s ease;
  z-index: 1;
}

.input-wrap .ic svg {
  width: 100%;
  height: 100%;
  display: block;
}

.input-wrap input {
  width: 100%;
  height: 52px;
  padding: 0 50px 0 46px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  color: var(--g-text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--g-glass-border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.input-wrap input::placeholder {
  color: rgba(157, 181, 168, 0.75);
}

.input-wrap input:hover {
  background: rgba(255, 255, 255, 0.08);
}

.input-wrap input:focus {
  border-color: var(--g-primary);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.18);
}

.input-wrap input:focus + .ic,
.input-wrap:focus-within .ic {
  color: var(--g-primary-light);
}

/* ---- Toggle contraseña ---- */
.btn-toggle-pass {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--g-text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.btn-toggle-pass:hover {
  color: var(--g-primary-light);
  background: rgba(255, 255, 255, 0.08);
}

.btn-toggle-pass svg {
  width: 20px;
  height: 20px;
}

/* ---- Botón submit ---- */
.btn-login {
  width: 100%;
  height: 52px;
  margin-top: 6px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--g-primary) 0%, var(--g-primary-dark) 100%);
  box-shadow: 0 12px 28px -8px rgba(40, 167, 69, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.btn-login:hover {
  filter: brightness(1.08);
  box-shadow: 0 16px 34px -8px rgba(40, 167, 69, 0.7);
  transform: translateY(-2px);
}

.btn-login:active {
  transform: translateY(0) scale(0.99);
}

.btn-login:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.btn-login .spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin 0.8s linear infinite;
}

.btn-login.loading .spinner {
  display: block;
}

.btn-login.loading .btn-label {
  opacity: 0.85;
}

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

/* ---- Footer ---- */
.login-footer {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  text-align: center;
  color: var(--g-text-muted);
  font-size: 12.5px;
  letter-spacing: 0.3px;
}

.login-footer strong {
  color: var(--g-text);
  font-weight: 600;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px 26px;
    border-radius: 16px;
  }

  .login-brand h1 {
    font-size: 30px;
    letter-spacing: 2.5px;
  }

  .login-logo {
    width: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-orbe,
  .login-card {
    animation: none;
  }
}
