/* ── MagicBook Login — Split Screen with Reveal Animation ── */
:root {
  --gold:       #c8873a;
  --gold-light: #e8a85a;
  --gold-dark:  #a06828;
  --brown:      #5c3317;
  --brown-dark: #3a1f0d;
  --cream:      #fdf6ec;
  --cream-2:    #fffcf7;
  --text:       #1a1209;
  --muted:      #8a7560;
  --border:     #e8ddd0;
  --danger-bg:  #fef0ee;
  --danger:     #c0392b;
  --success-bg: #eef8f1;
  --success:    #2e7d52;
  --shadow:     0 24px 64px rgba(92,51,23,.18);
}

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

html, body { height: 100%; }

.auth-body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── PAGE LAYOUT ── */
.login-page {
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════════
   PANEL IZQUIERDO — BRAND
══════════════════════════════════════ */
.login-brand {
  flex: 0 0 50%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brown-dark);

  /* Animación de entrada: slide desde izquierda */
  animation: slideInLeft 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

.brand-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(200,135,58,.35) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(92,51,23,.6)  0%, transparent 60%),
    linear-gradient(160deg, #1a0e06 0%, #3a1f0d 50%, #1a0e06 100%);
  z-index: 0;
}

/* Textura sutil */
.brand-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='1' fill='%23c8873a' opacity='.06'/%3E%3C/svg%3E");
  z-index: 0;
}

.brand-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 3rem 2.5rem;
  text-align: center;
}

/* Logo */
.brand-logo-wrap {
  position: relative;
  animation: logoReveal 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

@keyframes logoReveal {
  from { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  to   { transform: scale(1)   rotate(0deg);  opacity: 1; }
}

.brand-logo {
  width: 260px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(200,135,58,.5));
  transition: transform 0.4s ease;
}
.brand-logo:hover {
  transform: scale(1.04) rotate(1deg);
}

.logo-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse, rgba(200,135,58,.25) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: .6; }
  50%       { transform: scale(1.1); opacity: 1;  }
}

/* Tagline */
.brand-tagline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: fadeUp 0.7s ease 0.8s both;
}

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

.tag-line {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: #ffe0b0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tag-dot {
  color: var(--gold);
  font-size: 1.2rem;
  font-weight: 700;
}

.brand-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: rgba(255,224,176,.55);
  max-width: 280px;
  line-height: 1.6;
  animation: fadeUp 0.7s ease 1s both;
}

/* Partículas ✦ */
.particle {
  position: absolute;
  color: var(--gold);
  font-size: 0.9rem;
  animation: floatParticle linear infinite;
  opacity: 0.5;
  user-select: none;
}
.p1 { top: 12%; left: 15%; animation-duration: 8s;  animation-delay: 0s;   font-size: 1.1rem; }
.p2 { top: 20%; right: 12%; animation-duration: 10s; animation-delay: 1.5s; }
.p3 { top: 55%; left: 8%;   animation-duration: 7s;  animation-delay: 3s;   opacity: .3; }
.p4 { top: 70%; right: 18%; animation-duration: 9s;  animation-delay: 0.8s; }
.p5 { top: 35%; left: 20%;  animation-duration: 11s; animation-delay: 2s;   opacity: .25; }
.p6 { bottom: 15%; left: 50%; animation-duration: 8.5s; animation-delay: 1s; }

@keyframes floatParticle {
  0%   { transform: translateY(0)     rotate(0deg);   opacity: 0.5; }
  50%  { transform: translateY(-18px) rotate(180deg); opacity: 0.9; }
  100% { transform: translateY(0)     rotate(360deg); opacity: 0.5; }
}

/* Libros decorativos flotantes */
.deco-book {
  position: absolute;
  color: rgba(200,135,58,.15);
  font-size: 3.5rem;
  animation: floatBook ease-in-out infinite;
  user-select: none;
}
.b1 { bottom: 10%; left: 10%;  animation-duration: 6s;  animation-delay: 0s;   font-size: 2.8rem; }
.b2 { top: 8%;    right: 10%; animation-duration: 8s;  animation-delay: 2s;   font-size: 2.2rem; }
.b3 { top: 40%;   left: 5%;   animation-duration: 7s;  animation-delay: 4s;   font-size: 1.8rem; }

@keyframes floatBook {
  0%, 100% { transform: translateY(0)    rotate(-4deg); }
  50%       { transform: translateY(-12px) rotate(4deg); }
}

/* ══════════════════════════════════════
   PANEL DERECHO — FORMULARIO
══════════════════════════════════════ */
.login-form-panel {
  flex: 0 0 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--cream);
  position: relative;

  animation: fadeInRight 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

@keyframes fadeInRight {
  from { transform: translateX(60px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* Decoración sutil fondo derecho */
.login-form-panel::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(200,135,58,.06) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: cardReveal 0.8s cubic-bezier(0.34, 1.2, 0.64, 1) 0.35s both;
}

@keyframes cardReveal {
  from { transform: translateY(30px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Header */
.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  animation: fadeUp 0.6s ease 0.55s both;
}

.login-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--gold), var(--brown));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(200,135,58,.35);
  margin-bottom: 0.25rem;
}

.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 400;
}

/* Alerts */
.alert-error, .alert-success {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  animation: shakeIn 0.4s ease;
}

@keyframes shakeIn {
  0%   { transform: translateX(-6px); }
  25%  { transform: translateX(6px);  }
  50%  { transform: translateX(-3px); }
  75%  { transform: translateX(3px);  }
  100% { transform: translateX(0);    }
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(192,57,43,.2);
}
.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(46,125,82,.2);
}

/* Form Fields */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  animation: fadeUp 0.6s ease 0.65s both;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brown);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.field-wrap {
  position: relative;
}

.field-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.2s;
  padding-right: 2.8rem;
}

.field-input::placeholder { color: var(--muted); opacity: 0.6; }

.field-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,135,58,.12);
  background: #fffdf9;
}

.field-focus-bar {
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 0.3s ease, left 0.3s ease;
  pointer-events: none;
}
.field-input:focus ~ .field-focus-bar {
  width: 100%; left: 0;
}

.toggle-pass {
  position: absolute;
  right: 0.85rem; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  padding: 0.2rem;
  transition: color 0.2s;
}
.toggle-pass:hover { color: var(--gold); }

/* Submit Button */
.btn-login {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.5rem;
  margin-top: 0.25rem;
  background: linear-gradient(135deg, var(--gold) 0%, var(--brown) 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  letter-spacing: 0.03em;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 20px rgba(200,135,58,.4);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(200,135,58,.5);
}
.btn-login:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 1.15rem;
  transition: transform 0.25s;
}
.btn-login:hover .btn-icon {
  transform: translateX(4px);
}

.btn-ripple {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.12);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  pointer-events: none;
}
.btn-login:hover .btn-ripple {
  transform: scaleX(1);
}

/* Hints de credenciales */
.login-hints {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  animation: fadeUp 0.6s ease 0.85s both;
}

.hints-title {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.02em;
}

.hints-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.hint-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.25s;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.hint-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(200,135,58,.15);
  transform: translateY(-1px);
}

.hint-card > i:first-child {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.hint-admin > i:first-child  { color: var(--brown); }
.hint-cliente > i:first-child { color: var(--gold);  }

.hint-card div {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hint-card strong {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 600;
}

.hint-card span {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hint-arrow {
  font-size: 0.7rem !important;
  color: var(--muted) !important;
  transition: color 0.2s, transform 0.2s;
}
.hint-card:hover .hint-arrow {
  color: var(--gold) !important;
  transform: translateX(2px);
}

.hint-card.hint-active {
  background: linear-gradient(135deg, rgba(200,135,58,.08), rgba(92,51,23,.05));
  border-color: var(--gold);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .login-page {
    flex-direction: column;
  }

  .login-brand {
    flex: 0 0 auto;
    padding: 2.5rem 1.5rem 2rem;
    animation: slideInTop 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  @keyframes slideInTop {
    from { transform: translateY(-80px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
  }

  .brand-logo { width: 160px; }
  .brand-quote { display: none; }
  .deco-book { display: none; }

  .login-form-panel {
    flex: 1;
    animation: fadeInUp 0.7s ease 0.2s both;
  }

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

  .hints-grid { grid-template-columns: 1fr; }
}
