/* ============================================
   INVENTRIX TECHNOLOGIES — CLIENT PORTAL
   Proposal 2: Quantum Split (Production)
   ============================================ */

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

:root {
  --bg-left: #050A14;
  --bg-right: #080E1A;
  --accent-teal: #00E5C9;
  --accent-slate: #5B7BF5;
  --text-primary: #F0F2F5;
  --text-secondary: rgba(240, 242, 245, 0.50);
  --text-muted: rgba(240, 242, 245, 0.30);
  --card-surface: #0D1526;
  --card-border: rgba(255, 255, 255, 0.06);
  --error: #FF5C5C;
  --error-bg: rgba(255, 92, 92, 0.08);
  --error-border: rgba(255, 92, 92, 0.20);
  --input-bg: rgba(255, 255, 255, 0.03);
  --input-border: rgba(255, 255, 255, 0.08);
  --input-focus: rgba(0, 229, 201, 0.50);
  --input-focus-glow: rgba(0, 229, 201, 0.10);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

/* ============================================
   SPLIT LAYOUT
   ============================================ */

.split-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* ============================================
   LEFT PANEL — Animated Gradient Canvas
   ============================================ */

.left-panel {
  width: 50%;
  height: 100%;
  background: var(--bg-left);
  position: relative;
  overflow: hidden;
}

/* Animated gradient blobs */
.gradient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 229, 201, 0.15) 0%, transparent 70%);
  animation: blobMove1 20s ease-in-out infinite;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(91, 123, 245, 0.12) 0%, transparent 70%);
  animation: blobMove2 25s ease-in-out infinite;
}

.blob-3 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(0, 229, 201, 0.08) 0%, transparent 70%);
  animation: blobMove3 22s ease-in-out infinite;
}

@keyframes blobMove1 {
  0%, 100% { top: 20%; left: 10%; }
  33% { top: 60%; left: 40%; }
  66% { top: 30%; left: 70%; }
}

@keyframes blobMove2 {
  0%, 100% { top: 70%; left: 60%; }
  33% { top: 20%; left: 30%; }
  66% { top: 50%; left: 80%; }
}

@keyframes blobMove3 {
  0%, 100% { top: 40%; left: 80%; }
  33% { top: 70%; left: 20%; }
  66% { top: 10%; left: 50%; }
}

/* Technical dot grid overlay */
.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

/* Left panel brand content */
.left-content {
  position: absolute;
  bottom: 80px;
  left: 60px;
  z-index: 10;
  animation: fadeInLeft 1s ease 0.6s both;
}

.left-content h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 44px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.portal-label {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 12px;
}

.portal-desc {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 360px;
  margin-top: 20px;
  line-height: 1.6;
}

/* ============================================
   FEATHER EDGE (center seam blend)
   ============================================ */

.feather-edge {
  position: absolute;
  left: 50%;
  top: 0;
  width: 60px;
  height: 100%;
  transform: translateX(-50%);
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.3));
  z-index: 5;
  pointer-events: none;
}

/* ============================================
   RIGHT PANEL — Login Surface
   ============================================ */

.right-panel {
  width: 50%;
  height: 100%;
  background: var(--bg-right);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ============================================
   LOGIN CARD
   ============================================ */

.login-card {
  width: 100%;
  max-width: 400px;
  min-width: 320px;
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 48px 40px;
  animation: cardIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

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

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   CARD HEADER
   ============================================ */

.card-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(0, 229, 201, 0.15);
}

.card-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 24px;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.card-desc {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--text-secondary);
  margin: 8px 0 0 0;
}

/* ============================================
   ERROR BANNER
   ============================================ */

.error-banner {
  display: none;
  width: 100%;
  padding: 12px 16px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 10px;
  color: var(--error);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  margin-bottom: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  animation: slideDown 0.3s ease-out;
}

.error-banner.visible {
  display: flex;
}

.error-banner button {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.error-banner button:hover {
  opacity: 0.7;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 200px;
    margin-bottom: 20px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* ============================================
   INPUT FIELDS
   ============================================ */

.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-group:last-of-type {
  margin-bottom: 28px;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  display: flex;
  align-items: center;
  z-index: 2;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  height: 50px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 0 48px 0 48px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

input::placeholder {
  color: var(--text-secondary);
}

input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--input-focus-glow);
}

input.error-field {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(255, 92, 92, 0.10) !important;
}

.toggle-password {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  z-index: 2;
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: var(--accent-teal);
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */

.submit-btn {
  width: 100%;
  height: 50px;
  background: var(--accent-teal);
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #050A14;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 229, 201, 0.30);
}

.submit-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(5, 10, 20, 0.2);
  border-top-color: #050A14;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   CARD FOOTER
   ============================================ */

.card-footer {
  text-align: center;
  margin-top: 24px;
}

.forgot-link {
  background: none;        /* ← QUITA fondo gris de botón */
  border: none;            /* ← QUITA el borde */
  cursor: pointer;         /* ← Mantiene mano al pasar */
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-link:hover {
  color: var(--accent-teal);
}

.divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 24px 0;
}

.support-text {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

/* ============================================
   UTILITIES
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .split-container {
    flex-direction: column;
  }

  .left-panel {
    width: 100%;
    height: 240px;
    min-height: 240px;
  }

  .left-content {
    bottom: 30px;
    left: 24px;
  }

  .left-content h1 {
    font-size: 28px;
  }

  .portal-label {
    font-size: 12px;
  }

  .portal-desc {
    font-size: 15px;
    max-width: 280px;
    margin-top: 12px;
  }

  .feather-edge {
    display: none;
  }

  .right-panel {
    width: 100%;
    flex: 1;
    padding: 24px;
  }

  .login-card {
    min-width: auto;
    max-width: 100%;
    padding: 36px 24px;
  }
}

/* ============================================
   PASSWORD RECOVERY MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 5, 16, 0.70);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 48px 40px;
  animation: modalSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  z-index: 10;
}

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

.modal-header {
  text-align: center;
  margin-bottom: 28px;
}

.modal-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 16px;
  box-shadow: 0 0 16px rgba(0, 229, 201, 0.12);
}

.modal-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--text-primary);
  margin: 0;
}

.modal-desc {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--text-secondary);
  margin: 8px 0 0 0;
  line-height: 1.5;
}

/* Modal error */
.recover-error {
  width: 100%;
  padding: 12px 16px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 10px;
  color: var(--error);
  font-size: 13px;
  margin-bottom: 20px;
  animation: slideDown 0.3s ease-out;
}

/* Modal success state */
.modal-success {
  text-align: center;
  padding: 16px 0;
}

.success-icon {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.modal-success h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.modal-success .modal-desc {
  margin-bottom: 28px;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .gradient-blob,
  .login-card,
  .left-content,
  .modal-overlay,
  .modal-card {
    animation: none !important;
  }
  .login-card,
  .modal-card {
    opacity: 1;
    transform: none;
  }
  .left-content {
    opacity: 1;
    transform: none;
  }
  .modal-overlay {
    opacity: 1;
  }
}
