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

    :root {
      --blue:        #2a4fff;
      --blue-dark:   #1e3ae0;
      --blue-light:  #eef1ff;
      --navy:        #13172e;
      --gray-100:    #f4f6fb;
      --gray-200:    #e8ecf4;
      --gray-400:    #9ea8c0;
      --gray-600:    #5a6480;
      --white:       #ffffff;
      --red:         #e03131;
      --radius-sm:   8px;
      --radius-md:   12px;
      --radius-card: 20px;
      --font:        'Nunito', sans-serif;
    }

    html, body {
      height: 100%;
      font-family: var(--font);
      background: #0a0b10;
      -webkit-font-smoothing: antialiased;
    }

    /* ── Fondo con imagen ── */
    .bg-scene {
      position: fixed;
      inset: 0;
      background-image: url('../img/NC9.jpg');
      background-size: cover;
      background-position: center;
      z-index: 0;
    }

    /* overlay oscuro sobre la imagen */
    .bg-scene::after {
      content: '';
      position: absolute;
      inset: 0;
      background: rgba(8, 9, 18, 0.62);
    }

    /* ── Wrapper ── */
    .page {
      position: relative;
      z-index: 1;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding: 24px;
    }

    /* ── Card del login ── */
    .card {
      background: var(--white);
      border-radius: var(--radius-card);
      padding: 40px 36px 32px;
      width: 100%;
      max-width: 440px;
      display: flex;
      flex-direction: column;
    }

    /* ── Logo / Header ── */
    .logo-row {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 28px;
    }

    .logo-icon {
      width: 46px;
      height: 46px;
      background: var(--blue);
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .logo-icon svg { display: block; }

    .logo-text strong {
      display: block;
      font-size: 1.15rem;
      font-weight: 800;
      color: var(--navy);
      line-height: 1.2;
    }

    .logo-text span {
      font-size: .75rem;
      color: var(--gray-600);
      font-weight: 600;
      letter-spacing: .03em;
    }

    /* ── Títulos ── */
    .card-title {
      font-size: 1.4rem;
      font-weight: 800;
      color: var(--navy);
      margin-bottom: 6px;
    }

    .card-sub {
      font-size: .875rem;
      color: var(--gray-600);
      margin-bottom: 28px;
    }

    /* ── Inputs ── */
    .field {
      margin-bottom: 16px;
    }

    .field input {
      width: 100%;
      height: 50px;
      padding: 0 48px 0 16px;
      border: 1.5px solid var(--gray-200);
      border-radius: var(--radius-sm);
      font-family: var(--font);
      font-size: .93rem;
      color: var(--navy);
      background: var(--gray-100);
      outline: none;
      transition: border-color .2s, box-shadow .2s, background .2s;
    }

    .field input::placeholder { color: var(--gray-400); }

    .field input:focus {
      border-color: rgb(255, 90, 0);
      background: var(--white);
      box-shadow: 0 0 0 3px rgba(42, 79, 255, .12);
    }

    .field input.is-error {
      border-color: var(--red);
      box-shadow: 0 0 0 3px rgba(224, 49, 49, .10);
    }

    .input-wrap {
      position: relative;
    }

    .input-wrap .ico {
      position: absolute;
      right: 14px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--gray-400);
      cursor: pointer;
      display: flex;
      transition: color .2s;
    }

    .input-wrap .ico:hover { color: var(--blue); }

    .field-msg {
      font-size: .78rem;
      color: var(--red);
      margin-top: 5px;
      display: none;
    }

    .field-msg.show { display: block; }

    /* ── Fila: Recordar / Olvidé ── */
    .row-options {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 24px;
      flex-wrap: wrap;
    }

    .check-label {
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      font-size: .85rem;
      color: var(--gray-600);
      user-select: none;
      flex: 0 0 auto;
    }

    .check-label input[type="checkbox"] {
      width: 17px;
      height: 17px;
      accent-color: rgb(255, 90, 0);
      cursor: pointer;
      flex-shrink: 0;
    }

    .link-olvido {
      font-size: .85rem;
      font-weight: 700;
      color: rgb(255, 90, 0);
      text-decoration: none;
      transition: color .2s;
      flex: 0 0 auto;
    }

    .link-olvido:hover { color: rgb(255, 90, 0); text-decoration: none; }

    /* ── Alerta general ── */
    .alerta {
      border-radius: var(--radius-sm);
      padding: 11px 14px;
      font-size: .84rem;
      font-weight: 600;
      margin-bottom: 18px;
      display: none;
      align-items: center;
      gap: 9px;
    }

    .alerta.show { display: flex; }
    .alerta.error { background: #fff0f0; color: #b91c1c; border: 1px solid #fecaca; }
    .alerta.ok    { background: #f0fff4; color: #166534; border: 1px solid #bbf7d0; }

    /* ── Botón ── */
    .btn-submit {
      width: 100%;
      height: 50px;
      background: rgb(18, 140, 126);
      color: var(--white);
      border: none;
      border-radius: var(--radius-sm);
      font-family: var(--font);
      font-size: .95rem;
      font-weight: 800;
      letter-spacing: .04em;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      transition: background .2s, transform .15s, box-shadow .2s;
      margin-bottom: 10px;
    }

    .btn-submit:hover:not(:disabled) {
      background: rgb(7, 94, 84);
      box-shadow: 0 6px 20px rgba(7, 94, 84, .35);
      transform: translateY(-1px);
    }

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

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

    .spinner {
      width: 18px; height: 18px;
      border: 2.5px solid rgba(255,255,255,.3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin .65s linear infinite;
      display: none;
    }

    .btn-submit.loading .spinner { display: block; }
    .btn-submit.loading .btn-lbl { display: none; }

    /* Fila de botones Back + Submit */
    .row-btns {
      display: flex;
      gap: 12px;
      margin-bottom: 10px;
    }

    .btn-back {
      flex: 0 0 auto;
      height: 50px;
      padding: 0 24px;
      background: transparent;
      color: var(--gray-600);
      border: 1.5px solid var(--gray-200);
      border-radius: var(--radius-sm);
      font-family: var(--font);
      font-size: .95rem;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 7px;
      transition: border-color .2s, color .2s, background .2s;
      white-space: nowrap;
      text-decoration: none;
    }

    .btn-back:hover {
      border-color: rgb(255, 90, 0);
      color: rgb(255, 90, 0);
      background: rgba(255, 90, 0, .05);
    }

    .btn-back i { font-size: 1rem; }

    /* El btn-submit heredado del CSS base, solo le quitamos el margin-bottom aquí */
    .row-btns .btn-submit {
      flex: 1;
      margin-bottom: 0;
    }

    /* Mensaje de éxito — estado tras enviar */
    .estado-ok {
      display: none;
      flex-direction: column;
      align-items: center;
      text-align: center;
      padding: 8px 0 4px;
      gap: 14px;
    }

    .estado-ok.show { display: flex; }

    .ok-icono {
      width: 60px;
      height: 60px;
      background: #f0fff4;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.8rem;
      color: #16a34a;
      border: 2px solid #bbf7d0;
    }

    .ok-titulo {
      font-size: 1.1rem;
      font-weight: 800;
      color: var(--navy);
    }

    .ok-desc {
      font-size: .85rem;
      color: var(--gray-600);
      line-height: 1.6;
    }

    .ok-desc strong {
      color: var(--navy);
      font-weight: 700;
    }

    .btn-volver {
      width: 100%;
      height: 50px;
      background: rgb(18, 140, 126);
      color: var(--white);
      border: none;
      border-radius: var(--radius-sm);
      font-family: var(--font);
      font-size: .95rem;
      font-weight: 800;
      letter-spacing: .04em;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: background .2s, transform .15s;
      text-decoration: none;
      margin-top: 4px;
    }

    .btn-volver:hover {
      background: rgb(7, 94, 84);
      transform: translateY(-1px);
    }

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

    /* ── Footer ── */
    .card-footer {
      margin-top: 28px;
      padding-top: 20px;
      border-top: 1px solid var(--gray-200);
      text-align: center;
      font-size: .75rem;
      color: var(--gray-400);
    }

    /* ── Separador visual izquierdo ── */
    .left-brand {
      position: fixed;
      left: 40px;
      bottom: 40px;
      z-index: 2;
      display: none;
    }

    @media (min-width: 900px) { .left-brand { display: block; } }

    .left-brand p {
      color: rgba(255,255,255,.5);
      font-size: .8rem;
      font-weight: 600;
      letter-spacing: .08em;
      text-transform: uppercase;
      margin-bottom: 6px;
    }

    .left-brand h2 {
      color: var(--white);
      font-size: 2rem;
      font-weight: 800;
      line-height: 1.2;
      max-width: 340px;
    }

    .left-brand h2 span { color:  rgb(255, 90, 0);}

    /* ── Responsivo ── */
    @media (max-width: 600px) {
      .page {
        justify-content: center;
        padding: 16px;
        align-items: flex-start;
        padding-top: 130px;
      }

      .card {
        padding: 32px 24px 28px;
        max-width: 100%;
      }

      .card-title { font-size: 1.25rem; }
    }

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

    .card { animation: fadeUp .4s ease both; }

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