/* WebPortal Login Page (styled like Relay) */

:root {
  --primary: #000000;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #f5f7fa;
  min-height: 100vh;
  overflow: hidden;
}

/* ===== Background (plexus canvas) ===== */
.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #fafbfc 0%, #f0f3f6 100%);
}

#plexus-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* ===== Layout ===== */
.login-wrapper {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(18px);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
  100% { transform: translateX(0); }
}

.login-card.shake { animation: shake 0.45s ease-in-out; }

/* ===== Header ===== */
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-icon-text {
  font-weight: 800;
  letter-spacing: 0.06rem;
  color: var(--primary);
}

.login-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.login-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ===== Form ===== */
.form-group { margin-bottom: 1.5rem; }

label {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  display: block;
}

.input-wrapper { position: relative; }

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 14px;
  transition: all 0.2s ease;
  background: #fff;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}

.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-login:hover {
  background: #1f2937;
}

.btn-login:active { transform: translateY(0); }

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-login .spinner { display: none; margin-right: 8px; }
.btn-login.loading .spinner { display: inline-block; }
.btn-login.loading .btn-text { opacity: 0.95; }

/* ===== Captcha ===== */
.captcha-image {
  width: 100%;
  max-height: 120px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  margin-bottom: 10px;
}

.captcha-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.captcha-row input {
  flex: 1;
}

.btn-secondary {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.captcha-state {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* ===== Validation ===== */
.validation-summary {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  margin-bottom: 1rem;
}

.validation-summary-valid { display: none !important; }

.validation-summary ul {
  margin: 0;
  padding-left: 18px;
}

.validation-summary:has(li) { display: block; }

.field-validation {
  font-size: 12px;
  color: #b91c1c;
  margin-top: 4px;
  display: block;
}

.login-links {
  margin-top: 14px;
  text-align: center;
}

.login-links .link {
  color: #111827;
  text-decoration: none;
  font-size: 13px;
  opacity: 0.8;
}

.login-links .link:hover { opacity: 1; text-decoration: underline; }

