* {
      box-sizing: border-box;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    }

    body {
      margin: 0;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background: radial-gradient(circle at center, #ffffff 0%, #f0f2f5 100%);
    }

    @keyframes fadeInSlide {
      from {
        opacity: 0;
        transform: translateY(15px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .login-container {
      background: #ffffff;
      padding: 40px;
      border-radius: 20px;
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
      width: 100%;
      max-width: 360px;
      text-align: center;
      animation: fadeInSlide 0.4s ease-out forwards;
    }

    .brand-logo-text {
      font-size: 28px;
      font-weight: 800;
      color: #da291c;
      margin-bottom: 5px;
      letter-spacing: -0.5px;
    }

    .subtitle {
      font-size: 12px;
      color: #999;
      margin-bottom: 25px;
      font-weight: 500;
    }

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

    .input-icon-left {
      position: absolute;
      left: 16px;
      top: 50%;
      transform: translateY(-50%);
      color: #b0b0b0;
      font-size: 18px;
      pointer-events: none;
    }

    .input-icon-right {
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: #b0b0b0;
      font-size: 18px;
      cursor: pointer;
      background: none;
      border: none;
      padding: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      outline: none;
    }

    .input-icon-right:hover {
      color: #777;
    }

    .uclaro-input {
      width: 100%;
      padding: 14px 20px 14px 45px;
      border-radius: 50px;
      border: 1px solid #eee;
      background: #fff;
      font-size: 16px;
      /* Evita auto-zoom en iOS */
      color: #333;
      transition: all 0.2s;
      -webkit-appearance: none;
      /* Mejor renderizado en Safari mobile */
      appearance: none;
    }

    .uclaro-input::placeholder {
      color: #bbb;
    }

    .uclaro-input:focus {
      outline: none;
      border-color: #da291c;
      box-shadow: 0 0 0 3px rgba(218, 41, 28, 0.1);
    }

    .uclaro-input.has-right-icon {
      padding-right: 45px;
    }

    /* Ocultar el icono de revelar contraseña nativo de Edge/IE */
    input[type="password"]::-ms-reveal,
    input[type="password"]::-ms-clear {
      display: none;
    }

    .btn-login {
      width: 100%;
      min-height: 42px;
      padding: 0 18px;
      border-radius: 50px;
      border: none;
      background: #da291c;
      color: #fff;
      font-weight: 700;
      font-size: 13px;
      line-height: 1;
      letter-spacing: 0.4px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      margin-top: 12px;
      transition: background 0.2s, box-shadow 0.2s;
      box-shadow: 0 4px 15px rgba(218, 41, 28, 0.25);
    }

    .btn-login:hover {
      background: #c32418;
      box-shadow: 0 6px 20px rgba(218, 41, 28, 0.35);
    }

    .btn-login:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    .register-link {
      display: inline-block;
      margin-top: 25px;
      color: #da291c;
      font-size: 13px;
      font-weight: 700;
      text-decoration: none;
      transition: color 0.2s;
      padding: 10px;
      /* Mayor área de toque */
    }

    .register-link:hover {
      color: #a81c12;
      text-decoration: underline;
    }

    .footer-text {
      margin-top: 30px;
      font-size: 11px;
      color: #bbb;
    }

    .alert-error {
      background: #ffebee;
      color: #c62828;
      padding: 10px;
      border-radius: 8px;
      font-size: 12px;
      margin-bottom: 20px;
      display: none;
      border: 1px solid #ffcdd2;
    }

    .login-options {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      min-height: 22px;
      margin: 0 0 12px;
      font-size: 11px;
    }

    .remember-me {
      display: flex;
      align-items: center;
      gap: 6px;
      color: #777;
      cursor: pointer;
    }

    .remember-me input[type="checkbox"] {
      cursor: pointer;
      accent-color: #da291c;
      margin: 0;
    }

    .forgot-password {
      color: #da291c;
      text-decoration: none;
      font-weight: 600;
      transition: color 0.2s;
    }

    .forgot-password:hover {
      color: #a81c12;
      text-decoration: underline;
    }

    @media (max-width: 480px) {
      .login-container {
        padding: 40px 24px;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        width: 100%;
        max-width: 100%;
      }

      body {
        background: #ffffff;
        align-items: flex-start;
        /* Permite scroll natural si el teclado tapa */
        padding-top: 10vh;
      }

      .brand-logo-text {
        font-size: 36px;
      }
    }

/* Cambio obligatorio: todos los campos tienen el mismo ancho y se apilan en orden. */
.force-change-fields,
.force-change-field {
  width: 100%;
}

.force-change-fields .input-group,
.force-change-field.input-group {
  width: 100%;
  margin-bottom: 12px;
}

.force-change-fields .uclaro-input,
.force-change-field .uclaro-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.security-question-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin: 0 0 12px;
}

.security-question-row .uclaro-input {
  width: 100%;
}

@media (max-width: 640px) {
  .force-change-fields .input-group,
  .force-change-field.input-group {
    margin-bottom: 10px;
  }
}


/* Política obligatoria previa al acceso */
.siuc-modal.d-none {
  display: none !important;
}

.siuc-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.siuc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.siuc-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(94vw, 760px);
  max-height: min(90vh, 820px);
  overflow: hidden;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .30);
  animation: siucPolicyModalIn .18s ease-out;
}

.siuc-modal__header {
  flex: 0 0 auto;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.siuc-modal__title {
  margin: 0;
  color: #111827;
  font-size: 1.08rem;
  line-height: 1.35;
  font-weight: 750;
}

.siuc-policy-version {
  margin-top: 5px;
  color: #6b7280;
  font-size: .82rem;
}

.siuc-modal__body {
  min-height: 0;
  background: #fff;
}

.siuc-policy-scroll {
  flex: 1 1 auto;
  max-height: min(58vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 22px 24px;
  white-space: pre-wrap;
  color: #374151;
  font-size: .95rem;
  line-height: 1.65;
  text-align: left;
  word-break: break-word;
}

.siuc-policy-scroll:focus {
  outline: 2px solid rgba(218, 0, 0, .24);
  outline-offset: -2px;
}

.siuc-modal__footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px 20px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

#btnAcceptLoginPolicy {
  min-width: 190px;
  min-height: 44px;
  padding: 11px 20px;
  border: 0;
  border-radius: 24px;
  background: #e1251b;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(225, 37, 27, .22);
}

#btnAcceptLoginPolicy:hover:not(:disabled) {
  background: #c91f17;
}

#btnAcceptLoginPolicy:disabled {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none;
}

@keyframes siucPolicyModalIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
  .siuc-modal {
    align-items: flex-end;
    padding: 10px;
  }

  .siuc-modal__dialog,
  .siuc-policy-login-dialog {
    width: 100%;
    max-height: 94vh;
    border-radius: 18px 18px 12px 12px;
  }

  .siuc-modal__header {
    padding: 18px 18px 14px;
  }

  .siuc-policy-scroll {
    max-height: 62vh;
    padding: 18px;
  }

  .siuc-modal__footer {
    position: sticky;
    bottom: 0;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  }

  #btnAcceptLoginPolicy {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .siuc-modal__dialog {
    animation: none;
  }
}
