 :root {
    --bg-1: #e9f2ff;
    --bg-2: #f3e6ff;
    --bg-3: #fbe3f0;
    --bg-4: rgba(255, 255, 255, 0.55);
    --card-bg: rgba(255, 255, 255, 0.78);
    --primary: #2d7df6;
    --primary-hover: #2563eb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: rgba(255, 255, 255, 0.5);
    --input-bg: rgba(255, 255, 255, 0.7);
  }

  body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background:
      radial-gradient(circle at 20% 20%, #d8ecff 0%, transparent 45%),
      radial-gradient(circle at 80% 60%, #f2d6ff 0%, transparent 45%),
      radial-gradient(circle at 65% 85%, #ffd9e4 0%, transparent 45%),
      linear-gradient(135deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
    min-height: 100vh;
  }

  .login-page {
    min-height: 100vh;
    
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .login-card {
    width: 480px;
    background: var(--bg-4);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    padding: 34px 30px 28px;
    box-sizing: border-box;
    backdrop-filter: blur(18px);
  }

  .login-card .brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
    gap: 8px;
  }



/* Images */
  .brand-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 4px;
  }

  img.image-error {
  max-width: 350px;
  width: 350px !important;
  height: auto !important;
  object-fit: contain;
  margin-bottom: 12px;
  display: block;
}


  .brand-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.08em;
  }

  .brand-subtitle {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.18em;
  }

  .login-heading {
    margin: 8px 0 18px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: var(--text-main);
  }

  .login-card form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Bloque de error */
  .login-card .error-message {
    grid-column: 1 / -1;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;

    visibility: hidden;
    background: transparent;
    border: 1px solid transparent;
    color: inherit;
  }
  .login-card .error-message.active {
    visibility: visible;
    background: rgba(248, 113, 113, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #b91c1c;
  }

  .field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 8px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  background: var(--input-bg);
  width: 100%;
  min-height: 44px;
  }

.field-password {
  padding-right: 4px;
}

input#id_username.form-control {
  max-width: 85% !important;
}

  .field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(30, 136, 229, 0.15);
  }

  .field .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
  }

.field input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: var(--text-muted);
    padding: 8px;
  }



.field input:focus {
  background: var(--input-bg-focus);
  color: var(--text-main);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

/* Chrome autofill */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus,
.field input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
  box-shadow: 0 0 0 1000px var(--input-bg) inset;
  -webkit-text-fill-color: var(--text-main);
  caret-color: var(--text-main);
}

  .field input::placeholder {
    color: var(--text-muted);
  }

 
  

  .toggle-password {
    border: none;
    background: none;
    cursor: pointer;
  padding: 0;
    display: flex;
    align-items: center;
    color: var(--text-muted);
  }

  .toggle-password:hover {
    color: var(--text-main);
  }

  .btn-login {
    margin-top: 6px;
    width: 100%;
    border: none;
    background: var(--primary);
    color: #ffffff;
    padding: 12px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
    box-shadow: 0 12px 24px rgba(45, 125, 246, 0.25);
  }

  a.btn-login {
    text-align: center;
    display: block;
    text-decoration: none;
  }

  .btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
  }

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

  .forgot {
    display: block;
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
  }

  .forgot:hover {
    text-decoration: underline;
  }


    .login-heading {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
  }

   .recovery-instructions {
    font-size: 14px;
    color: var(--text-muted);
    padding: 14px;
    text-align: center;

  }


  @media (max-width: 480px) {
    .login-card {
      padding: 24px 18px 20px;
      border-radius: 18px;
      width: 100%;
    }
    .brand-logo {
      width: 72px;
      height: 72px;
    }
  }


 