/* ============================================
   TALLERO LOGIN — Compatible con zona interna
   Font: Ubuntu (misma que el admin)
   Palette: #107EFF brand blue
   ============================================ */

:root {
  --color-bg: #d3d1d1;
  --color-primary: #107EFF;
  --color-primary-hover: #0066d6;
  --color-primary-light: rgba(16, 126, 255, 0.08);
  --color-card: #FFFFFF;
  --color-text: #1A1A1A;
  --color-text-muted: #939393;
  --color-text-dim: #b0b0b0;
  --color-border: #d1d5db;
  --color-border-focus: #107EFF;
  --color-input-bg: #FFFFFF;
  --color-error-bg: #fef2f2;
  --color-error-border: #fecaca;
  --color-error: #dc2626;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-button: 0 4px 12px rgba(16, 126, 255, 0.3);
  --radius-card: 20px;
  --radius-input: 15px;
  --radius-button: 15px;
  --font-body: 'Ubuntu', -apple-system, sans-serif;
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
}

/* ============================================
   BACKGROUND
   ============================================ */

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 700px 600px at 50% 40%, rgba(16, 126, 255, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 85%, rgba(16, 126, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 400px 400px at 15% 15%, rgba(0, 0, 0, 0.04) 0%, transparent 50%),
    linear-gradient(160deg, #d6d4d0 0%, #cac7c2 50%, #d3d1d1 100%);
}

.login-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(16, 126, 255, 0.15) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none;
}

.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  pointer-events: none;
}

/* ============================================
   BLOBS — Organic morphing shapes
   ============================================ */

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform, border-radius;
  pointer-events: none;
}

.blob-1 {
  width: 550px;
  height: 550px;
  top: -12%;
  right: -8%;
  background: radial-gradient(circle, rgba(16, 126, 255, 0.25), rgba(16, 126, 255, 0.05));
  animation: blobMorph1 22s ease-in-out infinite;
}

.blob-2 {
  width: 450px;
  height: 450px;
  bottom: -15%;
  left: -6%;
  background: radial-gradient(circle, rgba(0, 102, 214, 0.2), rgba(0, 102, 214, 0.03));
  animation: blobMorph2 28s ease-in-out infinite;
}

.blob-3 {
  width: 300px;
  height: 300px;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(16, 126, 255, 0.12), transparent);
  animation: blobMorph3 18s ease-in-out infinite;
}

@keyframes blobMorph1 {
  0%, 100% { border-radius: 50% 50% 50% 50% / 60% 40% 60% 40%; transform: scale(1) translate(0, 0); }
  25% { border-radius: 40% 60% 30% 70% / 50% 60% 40% 50%; transform: scale(1.08) translate(30px, -20px); }
  50% { border-radius: 60% 40% 70% 30% / 40% 50% 60% 50%; transform: scale(0.94) translate(-20px, 30px); }
  75% { border-radius: 30% 70% 50% 50% / 60% 40% 50% 60%; transform: scale(1.05) translate(20px, 15px); }
}

@keyframes blobMorph2 {
  0%, 100% { border-radius: 40% 60% 60% 40% / 50% 40% 60% 50%; transform: scale(1) translate(0, 0); }
  33% { border-radius: 60% 40% 40% 60% / 60% 50% 50% 40%; transform: scale(1.1) translate(-25px, 20px); }
  66% { border-radius: 50% 50% 50% 50% / 40% 60% 40% 60%; transform: scale(0.92) translate(20px, -25px); }
}

@keyframes blobMorph3 {
  0%, 100% { border-radius: 50% 50% 40% 60% / 50% 50% 50% 50%; transform: scale(1) translate(-50%, -50%); }
  50% { border-radius: 55% 45% 50% 50% / 45% 55% 50% 50%; transform: scale(1.12) translate(-50%, -50%); }
}

/* ============================================
   MAIN
   ============================================ */

.login-main {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  animation: mainFadeIn 0.6s ease-out both;
}

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

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

.login-card {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  width: 100%;
  max-width: 920px;
  min-height: 520px;
  background: var(--color-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: cardEntrance 0.6s 0.05s both cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ============================================
   BRAND PANEL
   ============================================ */

.login-card-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 36px;
  background: linear-gradient(160deg, rgba(16, 126, 255, 0.05) 0%, rgba(16, 126, 255, 0.02) 100%);
  border-right: 1px solid #e5e7eb;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-card-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(16, 126, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.brand-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-primary);
  border: 3px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  animation: fadeSlideUp 0.5s 0.15s both;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16, 126, 255, 0.2);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-logo-placeholder {
  font-size: 34px;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1;
}

.brand-name {
  font-family: var(--font-body);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  animation: fadeSlideUp 0.5s 0.25s both;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-divider {
  width: 48px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 3px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  animation: fadeSlideUp 0.5s 0.35s both;
  flex-shrink: 0;
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  animation: fadeSlideUp 0.5s 0.4s both;
}

.brand-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 260px;
  position: relative;
  z-index: 1;
  animation: fadeSlideUp 0.5s 0.45s both;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   FORM PANEL
   ============================================ */

.login-card-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 44px;
  animation: fadeSlideUp 0.5s 0.3s both;
}

.form-header {
  margin-bottom: 32px;
}

.form-header h2 {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
  line-height: 1.2;
}

.form-header p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ============================================
   FORM
   ============================================ */

#form_login {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-input-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-input);
  padding: 0 16px;
  height: 48px;
  transition: var(--transition-smooth);
  position: relative;
}

.input-wrapper:focus-within {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(16, 126, 255, 0.1);
}

.input-wrapper i {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.input-wrapper:focus-within i {
  color: var(--color-primary);
}

.input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text);
  height: 100%;
  min-width: 0;
}

.input-wrapper input::placeholder {
  color: var(--color-text-dim);
  font-weight: 300;
  opacity: 0.7;
}

/* ============================================
   PASSWORD TOGGLE
   ============================================ */

.password-toggle {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
  flex-shrink: 0;
  line-height: 1;
}

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

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

.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: var(--radius-button);
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-button);
  margin-top: 6px;
  position: relative;
  overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 126, 255, 0.35);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-submit i {
  font-size: 0.85rem;
  transition: transform 0.25s ease;
}

.btn-submit:hover:not(:disabled) i {
  transform: translateX(4px);
}

/* Loading */
.btn-submit.loading span,
.btn-submit.loading i {
  visibility: hidden;
}

.btn-submit.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  z-index: 1;
}

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

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

.error-container {
  min-height: 24px;
}

.error-message {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--color-error);
  animation: errorAppear 0.3s ease;
}

.error-message i {
  font-size: 0.8rem;
  flex-shrink: 0;
}

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

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

.form-footer {
  margin-top: 28px;
  text-align: center;
}

.form-footer p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.form-footer a {
  color: var(--color-primary);
  font-weight: 500;
  transition: var(--transition-smooth);
}

.form-footer a:hover {
  color: var(--color-primary-hover);
}

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

@media (max-width: 820px) {
  .login-card {
    grid-template-columns: 1fr;
    min-height: auto;
    max-height: 96vh;
    overflow-y: auto;
  }

  .login-card-brand {
    padding: 36px 28px 28px;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .brand-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
  }

  .brand-logo-placeholder {
    font-size: 28px;
  }

  .brand-name {
    font-size: 1.5rem;
  }

  .brand-tagline {
    font-size: 0.75rem;
    margin-bottom: 14px;
  }

  .brand-desc {
    display: none;
  }

  .login-card-form {
    padding: 32px 28px;
  }

  .form-header h2 {
    font-size: 1.35rem;
  }
}

@media (max-width: 480px) {
  .login-main {
    padding: 10px;
  }

  .login-card {
    border-radius: 16px;
  }

  .login-card-brand {
    padding: 28px 20px 24px;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
    margin-bottom: 12px;
  }

  .brand-logo-placeholder {
    font-size: 22px;
  }

  .brand-name {
    font-size: 1.25rem;
  }

  .brand-divider {
    width: 40px;
    margin-bottom: 12px;
  }

  .brand-tagline {
    font-size: 0.7rem;
    margin-bottom: 0;
  }

  .login-card-form {
    padding: 24px 20px;
  }

  .form-header {
    margin-bottom: 24px;
  }

  .form-header h2 {
    font-size: 1.2rem;
  }

  .form-header p {
    font-size: 0.8rem;
  }

  #form_login {
    gap: 14px;
  }

  .input-wrapper {
    height: 44px;
    padding: 0 14px;
  }

  .btn-submit {
    height: 44px;
    font-size: 0.9rem;
  }
}

.login-card-form::-webkit-scrollbar {
  width: 4px;
}

.login-card-form::-webkit-scrollbar-track {
  background: transparent;
}

.login-card-form::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}
