/* ════════════════════════════════════════════════════════════
   BROKEN UFO — LOGIN FORM v1.0.0
   Cinematic OSINT Agent Authentication Styles
   ════════════════════════════════════════════════════════════ */

/* ── Form container ── */

.bufo-loginform {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  margin: 0;
}

/* ── Field groups ── */

.bufo-loginform .login-username,
.bufo-loginform .login-password {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Labels ── */

.bufo-loginform label {
  display: block;
  font-family: var(--bufo-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--bufo-text-4);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

/* ── Inputs ── */

.bufo-loginform input[type="text"],
.bufo-loginform input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-family: var(--bufo-mono);
  font-size: 13px;
  color: var(--bufo-text);
  letter-spacing: 0.02em;
  transition: all 0.25s ease;
  outline: none;
  box-sizing: border-box;
}

.bufo-loginform input[type="text"]::placeholder,
.bufo-loginform input[type="password"]::placeholder {
  color: var(--bufo-text-5);
  font-size: 12px;
}

.bufo-loginform input[type="text"]:hover,
.bufo-loginform input[type="password"]:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.5);
}

.bufo-loginform input[type="text"]:focus,
.bufo-loginform input[type="password"]:focus {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(0, 0, 0, 0.55);
  box-shadow:
    0 0 0 3px rgba(239, 68, 68, 0.1),
    0 0 16px rgba(239, 68, 68, 0.05);
}

/* Auth state: green accents */
.agent-menu.is-auth .bufo-loginform input[type="text"]:focus,
.agent-menu.is-auth .bufo-loginform input[type="password"]:focus {
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow:
    0 0 0 3px rgba(34, 197, 94, 0.08),
    0 0 16px rgba(34, 197, 94, 0.04);
}

/* ── Remember me checkbox ── */

.bufo-loginform .login-remember {
  margin: 2px 0 0;
}

.bufo-loginform .login-remember label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--bufo-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--bufo-text-4);
  text-transform: none;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.2s;
}

.bufo-loginform .login-remember label:hover {
  color: var(--bufo-text-3);
}

.bufo-loginform .login-remember input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  flex-shrink: 0;
}

.bufo-loginform .login-remember input[type="checkbox"]:hover {
  border-color: rgba(239, 68, 68, 0.3);
}

.bufo-loginform .login-remember input[type="checkbox"]:checked {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
}

.bufo-loginform .login-remember input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid rgba(239, 68, 68, 0.9);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Auth green */
.agent-menu.is-auth .bufo-loginform .login-remember input[type="checkbox"]:hover {
  border-color: rgba(34, 197, 94, 0.3);
}
.agent-menu.is-auth .bufo-loginform .login-remember input[type="checkbox"]:checked {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.45);
}
.agent-menu.is-auth .bufo-loginform .login-remember input[type="checkbox"]:checked::after {
  border-color: rgba(34, 197, 94, 0.85);
}

/* ── Submit button ── */

.bufo-loginform .login-submit {
  margin: 4px 0 0;
}

.bufo-loginbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08));
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  font-family: var(--bufo-mono);
  font-size: 12px;
  font-weight: 700;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.bufo-loginbtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.06), transparent);
  transition: left 0.5s ease;
}

.bufo-loginbtn:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(239, 68, 68, 0.12));
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow:
    0 0 20px rgba(239, 68, 68, 0.1),
    inset 0 1px 0 rgba(239, 68, 68, 0.08);
  transform: translateY(-1px);
}

.bufo-loginbtn:hover::before {
  left: 100%;
}

.bufo-loginbtn:active {
  transform: translateY(0);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.08);
}

/* Auth green state */
.agent-menu.is-auth .bufo-loginbtn {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.06));
  border-color: rgba(34, 197, 94, 0.25);
  color: var(--bufo-green);
}
.agent-menu.is-auth .bufo-loginbtn:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.1));
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow:
    0 0 20px rgba(34, 197, 94, 0.08),
    inset 0 1px 0 rgba(34, 197, 94, 0.06);
}
.agent-menu.is-auth .bufo-loginbtn::before {
  background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.05), transparent);
}

/* ── Login message area ── */

.bufo-loginmsg {
  min-height: 0;
  margin-top: 4px;
  font-family: var(--bufo-mono);
  font-size: 12px;
  line-height: 1.5;
  transition: all 0.3s ease;
}

.bufo-loginmsg:empty {
  display: none;
}

.bufo-loginmsg:not(:empty) {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  animation: bufo-loginmsg-in 0.3s ease;
}

/* Success state */
.bufo-loginmsg.is-success:not(:empty) {
  background: rgba(34, 197, 94, 0.06);
  border-color: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

@keyframes bufo-loginmsg-in {
  0%   { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Lost password link ── */

.agent-dropdown__link--sub {
  display: block;
  margin-top: 10px;
  font-family: var(--bufo-mono);
  font-size: 11px;
  color: var(--bufo-text-5);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.02em;
}
.agent-dropdown__link--sub:hover {
  color: var(--bufo-text-3);
}

/* ── Loading state on form submit ── */

.bufo-loginform.is-loading .bufo-loginbtn {
  pointer-events: none;
  opacity: 0.6;
}

.bufo-loginform.is-loading .bufo-loginbtn::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(239, 68, 68, 0.2);
  border-top-color: #ef4444;
  border-radius: 50%;
  animation: bufo-login-spin 0.6s linear infinite;
}
.agent-menu.is-auth .bufo-loginform.is-loading .bufo-loginbtn::after {
  border-color: rgba(34, 197, 94, 0.2);
  border-top-color: var(--bufo-green);
}

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