/* ═══════════════════════════════════════════════════
   WOLQEN — SaaS Portal Login Styles
   Domain: app.wolqen.com
   Theme: Midnight #101827 & Electric Cyan #42C8F5
   ═══════════════════════════════════════════════════ */

:root {
  --midnight: #101827;
  --midnight-2: #162238;
  --midnight-3: #1e2d4a;
  --midnight-card: rgba(22, 34, 56, 0.75);

  --cyan: #42C8F5;
  --cyan-hover: #5bd4ff;
  --cyan-subtle: rgba(66, 200, 245, 0.12);
  --cyan-glow: rgba(66, 200, 245, 0.35);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(66, 200, 245, 0.3);

  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --success: #10B981;

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  width: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--midnight);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  padding: 24px 16px;
  -webkit-font-smoothing: antialiased;
}

/* Background Atmosphere */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-glow-1 {
  position: absolute;
  top: -15%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(66, 200, 245, 0.12) 0%, transparent 70%);
  filter: blur(80px);
}

.ambient-glow-2 {
  position: absolute;
  bottom: -20%;
  right: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(66, 200, 245, 0.06) 0%, transparent 70%);
  filter: blur(100px);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(66, 200, 245, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 200, 245, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 80%);
  pointer-events: none;
  z-index: 1;
}

/* Container */
.login-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  margin: auto;
}

/* Glass Card */
.login-card {
  background: var(--midnight-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 
    0 24px 48px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 40px -10px var(--cyan-glow);
  position: relative;
}

/* Top Accent Line */
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  border-radius: var(--radius-full);
}

/* Header */
.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  text-decoration: none;
}

.login-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(66, 200, 245, 0.4));
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--cyan-subtle);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--cyan);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
}

.form-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(16, 24, 39, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: all var(--transition);
}

.form-input::placeholder {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.form-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(66, 200, 245, 0.15);
  background: rgba(22, 34, 56, 0.9);
}

.form-input:focus + .input-icon,
.input-wrap:focus-within .input-icon {
  color: var(--cyan);
}

.form-input.is-invalid {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.05);
}

.form-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Password Toggle */
.btn-toggle-pass {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.btn-toggle-pass:hover {
  color: var(--cyan);
}

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

/* Form Options (Remember & Forgot) */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 0.82rem;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.remember-checkbox {
  appearance: none;
  width: 16px;
  height: 16px;
  background: rgba(16, 24, 39, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: all var(--transition);
}

.remember-checkbox:checked {
  background: var(--cyan);
  border-color: var(--cyan);
}

.remember-checkbox:checked::before {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2px solid #101827;
  border-bottom: 2px solid #101827;
  transform: rotate(-45deg) translate(1px, -1px);
}

.forgot-link {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.forgot-link:hover {
  color: var(--cyan-hover);
  text-decoration: underline;
}

/* ══════════════════════════════
   CAPTCHA SECTION
══════════════════════════════ */
.captcha-container {
  background: rgba(16, 24, 39, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 24px;
}

.captcha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.captcha-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.captcha-shield-icon {
  width: 14px;
  height: 14px;
  color: var(--cyan);
}

.btn-refresh-captcha {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-family: var(--font-body);
  transition: all var(--transition);
}

.btn-refresh-captcha:hover {
  color: var(--cyan);
  background: var(--cyan-subtle);
}

.btn-refresh-captcha svg {
  width: 14px;
  height: 14px;
  transition: transform 0.4s ease;
}

.btn-refresh-captcha.spinning svg {
  transform: rotate(360deg);
}

.captcha-box {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.captcha-canvas-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(66, 200, 245, 0.25);
  background: #0B111D;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

#captcha-canvas {
  display: block;
  width: 130px;
  height: 44px;
}

.captcha-input {
  flex: 1;
  padding: 10px 12px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  background: rgba(16, 24, 39, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--cyan);
  outline: none;
  transition: all var(--transition);
}

.captcha-input::placeholder {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-muted);
  font-weight: 400;
}

.captcha-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(66, 200, 245, 0.2);
}

/* Error Message */
.error-banner {
  display: none;
  padding: 10px 14px;
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #FCA5A5;
  font-size: 0.82rem;
  margin-bottom: 20px;
  animation: fadeIn 0.2s ease;
}

.error-banner.show {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-error {
  display: block;
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 5px;
}

/* Submit Button */
.btn-login {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #42C8F5 0%, #1A9AC4 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #0A1628;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  box-shadow: 0 0 24px var(--cyan-glow);
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(66, 200, 245, 0.55);
  background: linear-gradient(135deg, #5bd4ff 0%, #20a7d4 100%);
}

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

.btn-login .btn-icon {
  width: 18px;
  height: 18px;
  transition: transform var(--transition);
}

.btn-login:hover .btn-icon {
  transform: translateX(3px);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(10, 22, 40, 0.3);
  border-top-color: #0A1628;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Card Footer */
.login-footer-info {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.login-footer-info svg {
  width: 14px;
  height: 14px;
  color: var(--success);
}

/* Page Outer Footer */
.page-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
}

.page-footer p {
  margin-bottom: 4px;
}

.page-footer-tagline {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--cyan);
}

/* ══════════════════════════════
   MODAL — Forgot Password
══════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 39, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  place-content: center;
  z-index: 100;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: grid;
}

.modal-card {
  background: #162238;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.7);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
}

.modal-close:hover { color: var(--text-primary); }

.modal-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 20px;
  }
  .captcha-box {
    flex-direction: column;
  }
  .captcha-canvas-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
  }
}
