/* ============================================
   SANTANDER VISIÓN 2050 — ESTILOS PRINCIPALES
   Paleta: Verde #006837 + Tierras + Oro
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=Fira+Sans:wght@300;400;500;600&display=swap');
:root {
      --verde-oscuro: #005C2E;
      --verde-medio: #006837;
      --verde-deep: #032016;
      --dorado: #C8963E;
      --dorado-claro: #e0b06a;
      --crema: #F7F3EC;
      --blanco: #FFFFFF;
      --texto: #1a1a1a;
      --texto-suave: #3d3d3d;
      --error: #c0392b;
    }

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

    html, body {
      height: 100%;
      font-family: 'Jost', sans-serif;
      background: var(--verde-deep);
      color: var(--blanco);
      overflow: hidden;
    }

    /* ── FONDO ANIMADO ── */
    .bg-layer {
      position: fixed;
      inset: 0;
      z-index: 0;
      background:
        radial-gradient(ellipse 80% 60% at 15% 50%, rgba(0,104,55,0.22) 0%, transparent 60%),
        radial-gradient(ellipse 60% 70% at 85% 30%, rgba(200,150,62,0.10) 0%, transparent 55%),
        radial-gradient(ellipse 50% 80% at 50% 100%, rgba(0,92,46,0.18) 0%, transparent 60%);
    }

    /* SVG botánico de fondo */
    .botanical-bg {
      position: fixed;
      inset: 0;
      width: 100%; height: 100%;
      pointer-events: none;
      opacity: 0.07;
      z-index: 0;
    }

    /* Partículas flotantes */
    .particles {
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      overflow: hidden;
    }
    .particle {
      position: absolute;
      border-radius: 50%;
      background: rgba(200,150,62,0.35);
      animation: floatUp linear infinite;
    }
    .particle:nth-child(1)  { width:3px; height:3px; left:10%; animation-duration:18s; animation-delay:0s; }
    .particle:nth-child(2)  { width:2px; height:2px; left:22%; animation-duration:24s; animation-delay:3s; }
    .particle:nth-child(3)  { width:4px; height:4px; left:38%; animation-duration:20s; animation-delay:6s; background:rgba(0,150,70,0.3); }
    .particle:nth-child(4)  { width:2px; height:2px; left:55%; animation-duration:22s; animation-delay:1s; }
    .particle:nth-child(5)  { width:3px; height:3px; left:70%; animation-duration:16s; animation-delay:8s; background:rgba(0,150,70,0.25); }
    .particle:nth-child(6)  { width:2px; height:2px; left:85%; animation-duration:26s; animation-delay:4s; }
    .particle:nth-child(7)  { width:5px; height:5px; left:92%; animation-duration:19s; animation-delay:11s; background:rgba(200,150,62,0.2); }
    .particle:nth-child(8)  { width:2px; height:2px; left:48%; animation-duration:21s; animation-delay:7s; }
    @keyframes floatUp {
      0%   { transform: translateY(110vh) scale(0.5); opacity: 0; }
      10%  { opacity: 1; }
      90%  { opacity: 0.6; }
      100% { transform: translateY(-10vh) scale(1); opacity: 0; }
    }

    /* ── LAYOUT ── */
    .page {
      position: relative;
      z-index: 1;
      min-height: 100vh;
      display: grid;
      grid-template-columns: 1fr 1fr;
    }

    /* ── PANEL IZQUIERDO ── */
    .panel-left {
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: 4rem 3.5rem 4rem 5rem;
      border-right: 1px solid rgba(200,150,62,0.12);
      opacity: 0;
      animation: slideLeft 0.9s 0.2s cubic-bezier(0.16,1,0.3,1) forwards;
    }

    .brand-row {
      display: flex;
      align-items: center;
      gap: 1rem;
      margin-bottom: 3.5rem;
    }
    .brand-icon {
      width: 52px;
      height: 52px;
      border-radius: 14px;
      background: rgba(0,104,55,0.2);
      border: 1px solid rgba(200,150,62,0.3);
      display: flex; align-items: center; justify-content: center;
      padding: 6px;
    }
    .brand-icon img {
      width: 100%; height: auto;
      filter: brightness(1.1);
    }
    .brand-text {
      display: flex;
      flex-direction: column;
    }
    .brand-name {
      font-family: 'Jost', sans-serif;
      font-weight: 500;
      font-size: 0.82rem;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.9);
    }
    .brand-sub {
      font-size: 0.68rem;
      letter-spacing: 0.28em;
      color: rgba(200,150,62,0.85);
      font-weight: 400;
    }

    .left-eyebrow {
      font-size: 0.68rem;
      letter-spacing: 0.3em;
      text-transform: uppercase;
      color: rgba(200,150,62,0.7);
      margin-bottom: 1.2rem;
    }

    .left-title {
      font-family: 'Cormorant Garamond', serif;
      font-weight: 300;
      font-size: clamp(2.4rem, 3.5vw, 3.4rem);
      line-height: 1.15;
      color: var(--blanco);
      margin-bottom: 1.4rem;
    }
    .left-title em {
      font-style: italic;
      color: var(--dorado-claro);
    }

    .left-desc {
      font-size: 0.92rem;
      line-height: 1.8;
      color: rgba(255,255,255,0.55);
      max-width: 400px;
      margin-bottom: 3rem;
    }

    .left-ornament {
      display: flex;
      align-items: center;
      gap: 0.8rem;
      margin-bottom: 2.5rem;
    }
    .lo-line {
      width: 40px; height: 1px;
      background: linear-gradient(90deg, transparent, rgba(200,150,62,0.5));
    }
    .lo-diamond {
      width: 6px; height: 6px;
      background: var(--dorado);
      transform: rotate(45deg);
      opacity: 0.7;
    }
    .lo-line-r {
      flex: 1; height: 1px;
      background: linear-gradient(90deg, rgba(200,150,62,0.3), transparent);
    }

    .left-stats {
      display: flex;
      gap: 2rem;
    }
    .ls-item {
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }
    .ls-num {
      font-family: 'Cormorant Garamond', serif;
      font-size: 1.8rem;
      font-weight: 300;
      color: var(--dorado-claro);
      line-height: 1;
    }
    .ls-label {
      font-size: 0.68rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.4);
    }

    /* ── PANEL DERECHO — FORMULARIO ── */
    .panel-right {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding: 4rem 5rem 4rem 4rem;
      opacity: 0;
      animation: slideRight 0.9s 0.4s cubic-bezier(0.16,1,0.3,1) forwards;
    }

    .login-card {
      width: 100%;
      max-width: 400px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(200,150,62,0.18);
      border-radius: 20px;
      padding: 2.8rem 2.4rem;
      backdrop-filter: blur(12px);
      box-shadow:
        0 0 0 1px rgba(0,0,0,0.2),
        0 32px 64px rgba(0,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.06);
      position: relative;
      overflow: hidden;
    }

    .login-card::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 2px;
      background: linear-gradient(90deg, transparent, var(--dorado), transparent);
      opacity: 0.6;
    }

    .card-eyebrow {
      font-size: 0.66rem;
      letter-spacing: 0.28em;
      text-transform: uppercase;
      color: rgba(200,150,62,0.7);
      margin-bottom: 0.6rem;
      text-align: center;
    }

    .card-title {
      font-family: 'Cormorant Garamond', serif;
      font-weight: 300;
      font-size: 1.7rem;
      color: var(--blanco);
      text-align: center;
      margin-bottom: 0.4rem;
    }

    .card-subtitle {
      font-size: 0.8rem;
      color: rgba(255,255,255,0.4);
      text-align: center;
      margin-bottom: 2.2rem;
    }

    /* Campos */
    .field {
      margin-bottom: 1.2rem;
    }

    .field label {
      display: block;
      font-size: 0.72rem;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.55);
      margin-bottom: 0.5rem;
    }

    .field-wrap {
      position: relative;
    }

    .field-icon {
      position: absolute;
      left: 0.95rem;
      top: 50%;
      transform: translateY(-50%);
      width: 16px; height: 16px;
      opacity: 0.45;
      pointer-events: none;
    }

    .field input {
      width: 100%;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 10px;
      padding: 0.78rem 1rem 0.78rem 2.6rem;
      font-family: 'Jost', sans-serif;
      font-size: 0.9rem;
      color: var(--blanco);
      outline: none;
      transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
      letter-spacing: 0.02em;
    }

    .field input::placeholder {
      color: rgba(255,255,255,0.22);
    }

    .field input:focus {
      border-color: rgba(200,150,62,0.55);
      background: rgba(255,255,255,0.09);
      box-shadow: 0 0 0 3px rgba(200,150,62,0.1);
    }

    .field input.input-error {
      border-color: rgba(192,57,43,0.6);
      box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
    }

    /* Toggle contraseña */
    .toggle-pw {
      position: absolute;
      right: 0.85rem;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      cursor: pointer;
      padding: 0.2rem;
      display: flex;
      align-items: center;
      opacity: 0.4;
      transition: opacity 0.2s;
    }
    .toggle-pw:hover { opacity: 0.8; }
    .toggle-pw svg { width: 16px; height: 16px; fill: none; stroke: white; stroke-width: 1.8; }

    /* Mensaje de error */
    .error-msg {
      display: none;
      align-items: center;
      gap: 0.5rem;
      background: rgba(192,57,43,0.12);
      border: 1px solid rgba(192,57,43,0.3);
      border-radius: 8px;
      padding: 0.7rem 0.9rem;
      font-size: 0.8rem;
      color: #e8857a;
      margin-bottom: 1.2rem;
      animation: shakeX 0.4s ease;
    }
    .error-msg.visible { display: flex; }
    .error-msg svg { width: 14px; height: 14px; flex-shrink: 0; fill: #e8857a; }

    @keyframes shakeX {
      0%,100% { transform: translateX(0); }
      20%      { transform: translateX(-6px); }
      40%      { transform: translateX(6px); }
      60%      { transform: translateX(-4px); }
      80%      { transform: translateX(4px); }
    }

    /* Botón de acceso */
    .btn-login {
      width: 100%;
      padding: 0.88rem 1.5rem;
      background: linear-gradient(135deg, var(--verde-medio), #007a40);
      border: 1px solid rgba(200,150,62,0.3);
      border-radius: 10px;
      font-family: 'Jost', sans-serif;
      font-size: 0.85rem;
      font-weight: 500;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.95);
      cursor: pointer;
      position: relative;
      overflow: hidden;
      transition: transform 0.2s, box-shadow 0.2s;
      margin-top: 0.4rem;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.6rem;
    }

    .btn-login::before {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, rgba(200,150,62,0.15), transparent);
      opacity: 0;
      transition: opacity 0.25s;
    }
    .btn-login:hover::before { opacity: 1; }
    .btn-login:hover {
      transform: translateY(-1px);
      box-shadow: 0 8px 24px rgba(0,104,55,0.35), 0 0 0 1px rgba(200,150,62,0.2);
    }
    .btn-login:active { transform: translateY(0); }

    .btn-login .btn-arrow {
      transition: transform 0.2s;
    }
    .btn-login:hover .btn-arrow { transform: translateX(3px); }

    /* Loading state */
    .btn-login.loading .btn-text { opacity: 0; }
    .btn-login.loading::after {
      content: '';
      position: absolute;
      width: 18px; height: 18px;
      border: 2px solid rgba(255,255,255,0.3);
      border-top-color: white;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* Separador */
    .card-divider {
      display: flex;
      align-items: center;
      gap: 0.8rem;
      margin: 1.5rem 0 1.2rem;
      opacity: 0.3;
    }
    .card-divider::before,
    .card-divider::after {
      content: '';
      flex: 1; height: 1px;
      background: rgba(255,255,255,0.2);
    }
    .card-divider span {
      font-size: 0.65rem;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.6);
    }

    /* Footer de la card */
    .card-footer {
      text-align: center;
      font-size: 0.75rem;
      color: rgba(255,255,255,0.28);
      margin-top: 1.5rem;
      line-height: 1.7;
    }
    .card-footer strong {
      color: rgba(200,150,62,0.6);
      font-weight: 400;
    }

    /* ── ACCESO EXITOSO ── */
    .success-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 100;
      background: var(--verde-deep);
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 1.5rem;
      animation: fadeIn 0.4s ease;
    }
    .success-overlay.show { display: flex; }

    .success-icon {
      width: 72px; height: 72px;
      border-radius: 50%;
      background: rgba(0,104,55,0.2);
      border: 1px solid rgba(200,150,62,0.4);
      display: flex; align-items: center; justify-content: center;
      animation: popIn 0.5s 0.2s cubic-bezier(0.16,1,0.3,1) both;
    }
    .success-icon svg { width: 32px; height: 32px; stroke: var(--dorado-claro); stroke-width: 2; fill: none; }

    .success-text {
      font-family: 'Cormorant Garamond', serif;
      font-size: 1.5rem;
      font-weight: 300;
      color: rgba(255,255,255,0.9);
      animation: fadeUp 0.5s 0.35s ease both;
    }
    .success-sub {
      font-size: 0.82rem;
      color: rgba(255,255,255,0.4);
      letter-spacing: 0.1em;
      animation: fadeUp 0.5s 0.45s ease both;
    }
    .success-bar {
      width: 200px; height: 2px;
      background: rgba(255,255,255,0.08);
      border-radius: 2px;
      overflow: hidden;
      animation: fadeUp 0.5s 0.5s ease both;
    }
    .success-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--verde-medio), var(--dorado));
      border-radius: 2px;
      animation: loadBar 1.8s 0.6s ease forwards;
      width: 0;
    }
    @keyframes loadBar { to { width: 100%; } }

    /* ── ANIMACIONES ENTRADA ── */
    @keyframes slideLeft {
      from { opacity: 0; transform: translateX(-30px); }
      to   { opacity: 1; transform: translateX(0); }
    }
    @keyframes slideRight {
      from { opacity: 0; transform: translateX(30px); }
      to   { opacity: 1; transform: translateX(0); }
    }
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(12px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to   { opacity: 1; }
    }
    @keyframes popIn {
      from { opacity: 0; transform: scale(0.6); }
      to   { opacity: 1; transform: scale(1); }
    }

    /* ── RESPONSIVE ── */
    @media (max-width: 820px) {
      html, body { overflow: auto; }
      .page { grid-template-columns: 1fr; }
      .panel-left {
        padding: 3rem 2rem 2rem;
        border-right: none;
        border-bottom: 1px solid rgba(200,150,62,0.12);
      }
      .left-title { font-size: 2.2rem; }
      .left-stats { gap: 1.5rem; }
      .panel-right { padding: 2.5rem 1.5rem 4rem; }
    } 
